Skip to content

Commit 44b4736

Browse files
ChristopherHXtechknowlogick
authored andcommitted
feat: docker env vars for ephemeral and once (#685)
* GITEA_RUNNER_EPHEMERAL=1 * GITEA_RUNNER_ONCE=1 Related https://gitea.com/gitea/act_runner/issues/684 Reviewed-on: https://gitea.com/gitea/act_runner/pulls/685 Reviewed-by: techknowlogick <[email protected]> Co-authored-by: Christopher Homberger <[email protected]> Co-committed-by: Christopher Homberger <[email protected]>
1 parent b1ae30d commit 44b4736

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/run.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ EXTRA_ARGS=""
1616
if [[ ! -z "${GITEA_RUNNER_LABELS}" ]]; then
1717
EXTRA_ARGS="${EXTRA_ARGS} --labels ${GITEA_RUNNER_LABELS}"
1818
fi
19+
if [[ ! -z "${GITEA_RUNNER_EPHEMERAL}" ]]; then
20+
EXTRA_ARGS="${EXTRA_ARGS} --ephemeral"
21+
fi
22+
RUN_ARGS=""
23+
if [[ ! -z "${GITEA_RUNNER_ONCE}" ]]; then
24+
RUN_ARGS="${RUN_ARGS} --once"
25+
fi
1926

2027
# In case no token is set, it's possible to read the token from a file, i.e. a Docker Secret
2128
if [[ -z "${GITEA_RUNNER_REGISTRATION_TOKEN}" ]] && [[ -f "${GITEA_RUNNER_REGISTRATION_TOKEN_FILE}" ]]; then
@@ -54,4 +61,4 @@ fi
5461
unset GITEA_RUNNER_REGISTRATION_TOKEN
5562
unset GITEA_RUNNER_REGISTRATION_TOKEN_FILE
5663

57-
exec act_runner daemon ${CONFIG_ARG}
64+
exec act_runner daemon ${CONFIG_ARG} ${RUN_ARGS}

0 commit comments

Comments
 (0)