mirror of
https://github.com/casjaysdevdocker/gitea
synced 2024-11-21 11:23:07 -05:00
🗃️ Committing everything that changed 🗃️
rootfs/usr/local/etc/docker/init.d/zz-act_runner.sh
This commit is contained in:
parent
91038294a3
commit
1cf9fb1172
@ -266,6 +266,12 @@ RUNNER_LABELS="$RUNNER_LABELS"
|
|||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f "$CONF_DIR/daemon.yaml" ]; then
|
||||||
|
if [ ! -f "$CONF_DIR/runners" ]; then
|
||||||
|
act_runner register --config "$CONF_DIR/daemon.yaml" --labels "$RUNNER_LABELS" --name "gitea" --instance "http://127.0.0.1:8000" --token "$SYS_AUTH_TOKEN" --no-interactive 2>/dev/stdout
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
for runner in "$CONF_DIR/reg"/*.reg; do
|
for runner in "$CONF_DIR/reg"/*.reg; do
|
||||||
while :; do
|
while :; do
|
||||||
[ -f "$runner" ] && . "$runner"
|
[ -f "$runner" ] && . "$runner"
|
||||||
@ -279,7 +285,7 @@ EOF
|
|||||||
RUNNER_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$SYS_AUTH_TOKEN}"
|
RUNNER_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$SYS_AUTH_TOKEN}"
|
||||||
RUNNER_LABELS="${RUNNER_LABELS:-act_runner}"
|
RUNNER_LABELS="${RUNNER_LABELS:-act_runner}"
|
||||||
[ -n "$RUNNER_NAME" ] && [ -n "$RUNNER_HOME" ] || break
|
[ -n "$RUNNER_NAME" ] && [ -n "$RUNNER_HOME" ] || break
|
||||||
if [ -n "$RUNNER_AUTH_TOKEN" ]; then
|
if [ -z "$RUNNER_AUTH_TOKEN" ]; then
|
||||||
RUNNER_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$SYS_AUTH_TOKEN}"
|
RUNNER_AUTH_TOKEN="${RUNNER_AUTH_TOKEN:-$SYS_AUTH_TOKEN}"
|
||||||
echo "$RUNNER_AUTH_TOKEN" >"$CONF_DIR/tokens/$RUNNER_NAME"
|
echo "$RUNNER_AUTH_TOKEN" >"$CONF_DIR/tokens/$RUNNER_NAME"
|
||||||
chmod -Rf 600 "$CONF_DIR/tokens/system" "$CONF_DIR/tokens/$RUNNER_NAME" 2>/dev/null
|
chmod -Rf 600 "$CONF_DIR/tokens/system" "$CONF_DIR/tokens/$RUNNER_NAME" 2>/dev/null
|
||||||
@ -288,7 +294,6 @@ EOF
|
|||||||
echo "Then edit $runner or set in $CONF_DIR/tokens/$RUNNER_NAME" >&2
|
echo "Then edit $runner or set in $CONF_DIR/tokens/$RUNNER_NAME" >&2
|
||||||
sleep 120
|
sleep 120
|
||||||
else
|
else
|
||||||
[ -f "$runner" ] && . "$runner"
|
|
||||||
echo "creating $RUNNER_NAME in $RUNNER_HOME and registering with $RUNNER_REGISTER_URL"
|
echo "creating $RUNNER_NAME in $RUNNER_HOME and registering with $RUNNER_REGISTER_URL"
|
||||||
mkdir -p "$RUNNER_HOME"
|
mkdir -p "$RUNNER_HOME"
|
||||||
[ -f "$RUNNER_HOME/daemon.yaml" ] || copy "$ETC_DIR/multi.yaml" "$RUNNER_HOME/daemon.yaml"
|
[ -f "$RUNNER_HOME/daemon.yaml" ] || copy "$ETC_DIR/multi.yaml" "$RUNNER_HOME/daemon.yaml"
|
||||||
|
Loading…
Reference in New Issue
Block a user