mirror of
https://github.com/casjaysdevdocker/gitea
synced 2024-11-21 17:23:06 -05:00
🗃️ Committing everything that changed 🗃️
rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
This commit is contained in:
parent
827f0aa206
commit
07c8321d67
@ -261,11 +261,12 @@ EOF
|
|||||||
cp -Rf "$CONF_DIR/multi.yaml" "$RUNNER_HOME/$RUNNER_NAME.yaml"
|
cp -Rf "$CONF_DIR/multi.yaml" "$RUNNER_HOME/$RUNNER_NAME.yaml"
|
||||||
__replace "REPLACE_RUNNER_HOME" "$RUNNER_HOME" "$RUNNER_HOME/$RUNNER_NAME.yaml"
|
__replace "REPLACE_RUNNER_HOME" "$RUNNER_HOME" "$RUNNER_HOME/$RUNNER_NAME.yaml"
|
||||||
act_runner register --config "$RUNNER_HOME/$RUNNER_NAME.yaml" --labels "$RUNNER_LABELS" --name "$RUNNER_NAME" --instance "http://$CONTAINER_IP4_ADDRESS:8000" --token "$RUNNER_AUTH_TOKEN" --no-interactive && exitStatus=0 || exitStatus=1
|
act_runner register --config "$RUNNER_HOME/$RUNNER_NAME.yaml" --labels "$RUNNER_LABELS" --name "$RUNNER_NAME" --instance "http://$CONTAINER_IP4_ADDRESS:8000" --token "$RUNNER_AUTH_TOKEN" --no-interactive && exitStatus=0 || exitStatus=1
|
||||||
echo "$!" >"$RUN_DIR/act_runner.$RUNNER_NAME.pid"
|
exitStatus=$?
|
||||||
if [ $exitStatus -eq 0 ]; then
|
if [ $exitStatus -eq 0 ]; then
|
||||||
exitStatus=0
|
exitStatus=0
|
||||||
cp -Rf "$runner" "$RUNNER_HOME/$RUNNER_NAME.reg"
|
cp -Rf "$runner" "$RUNNER_HOME/$RUNNER_NAME.reg"
|
||||||
chown -Rf "$SERVICE_USER":"$SERVICE_GROUP" "$RUNNER_HOME"
|
chown -Rf "$SERVICE_USER":"$SERVICE_GROUP" "$RUNNER_HOME"
|
||||||
|
echo "$!" >"$RUN_DIR/act_runner.$RUNNER_NAME.pid"
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
[ -f "$RUN_DIR/act_runner.$RUNNER_NAME.pid" ] && rm -f "$RUN_DIR/act_runner.$RUNNER_NAME.pid"
|
[ -f "$RUN_DIR/act_runner.$RUNNER_NAME.pid" ] && rm -f "$RUN_DIR/act_runner.$RUNNER_NAME.pid"
|
||||||
@ -364,9 +365,15 @@ __post_execute() {
|
|||||||
__banner "$postMessageST"
|
__banner "$postMessageST"
|
||||||
# commands to execute
|
# commands to execute
|
||||||
for multi in "$CONF_DIR/multi"/*; do
|
for multi in "$CONF_DIR/multi"/*; do
|
||||||
|
unset pid is_running name
|
||||||
name="$(basename "$multi")"
|
name="$(basename "$multi")"
|
||||||
if [ -f "$$multi/$name.yaml" ] && [ -f "$multi/runners" ]; then
|
if [ -f "$$multi/$name.yaml" ] && [ -f "$multi/runners" ]; then
|
||||||
act_runner daemon --config $multi/$name.yaml
|
act_runner daemon --config $multi/$name.yaml &
|
||||||
|
local pid=$!
|
||||||
|
sleep 5 && ps ax | awk '{print $1}' | grep -v grep | grep -q "$execPid$" && is_running="yes"
|
||||||
|
if [ "$is_running" = "yes" ]; then
|
||||||
|
echo "$pid" >"$RUN_DIR/act_runner.$name.pid"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user