mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-11-23 23:50:58 -05:00
daemonize forgejo-runner
This commit is contained in:
parent
03450c69a0
commit
202709a555
1 changed files with 4 additions and 5 deletions
|
@ -10,8 +10,8 @@ function dependencies() {
|
||||||
tar zxf go1.20.2.linux-amd64.tar.gz
|
tar zxf go1.20.2.linux-amd64.tar.gz
|
||||||
export PATH=$PATH:$(pwd)/go/bin
|
export PATH=$PATH:$(pwd)/go/bin
|
||||||
fi
|
fi
|
||||||
if ! which make > /dev/null ; then
|
if ! which make daemon > /dev/null ; then
|
||||||
apt-get install -y -qq make
|
apt-get install -y -qq make daemon
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,8 +39,7 @@ function register() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function run() {
|
function run() {
|
||||||
./forgejo-runner/forgejo-runner daemon >& forgejo-runner.log &
|
daemon --chdir=$(pwd) --unsafe --pidfile=$(pwd)/forgejo-runner-pid --errlog=$(pwd)/forgejo-runner.log --output=$(pwd)/forgejo-runner.log ./forgejo-runner/forgejo-runner daemon
|
||||||
echo $! > forgejo-runner-pid
|
|
||||||
sleep 1
|
sleep 1
|
||||||
cat forgejo-runner.log
|
cat forgejo-runner.log
|
||||||
}
|
}
|
||||||
|
@ -59,7 +58,7 @@ function setup() {
|
||||||
|
|
||||||
function teardown() {
|
function teardown() {
|
||||||
if test -f forgejo-runner-pid ; then
|
if test -f forgejo-runner-pid ; then
|
||||||
kill -9 $(cat forgejo-runner-pid)
|
kill -TERM $(cat forgejo-runner-pid)
|
||||||
rm -f forgejo-runner-pid
|
rm -f forgejo-runner-pid
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue