generated from oci/template
shfmt entrypoint.sh
This commit is contained in:
parent
ca84c6f041
commit
bd6aebbc8c
1 changed files with 13 additions and 13 deletions
|
@ -26,8 +26,8 @@ fi
|
||||||
|
|
||||||
# Handle if `command` is passed, as command appends arguments to the entrypoint
|
# Handle if `command` is passed, as command appends arguments to the entrypoint
|
||||||
if [ "$#" -gt 0 ]; then
|
if [ "$#" -gt 0 ]; then
|
||||||
run_command $@
|
run_command $@
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Handle and alter the config file
|
# Handle and alter the config file
|
||||||
|
@ -99,19 +99,19 @@ if [[ ! -s "${RUNNER_FILE}" ]]; then
|
||||||
while [[ $success -eq 0 ]] && [[ $try -lt ${MAX_REG_ATTEMPTS:-10} ]]; do
|
while [[ $success -eq 0 ]] && [[ $try -lt ${MAX_REG_ATTEMPTS:-10} ]]; do
|
||||||
if [[ ! -z "${FORGEJO_SECRET}" ]]; then
|
if [[ ! -z "${FORGEJO_SECRET}" ]]; then
|
||||||
run_command forgejo-runner create-runner-file --connect \
|
run_command forgejo-runner create-runner-file --connect \
|
||||||
--instance "${FORGEJO_URL:-http://forgejo:3000}" \
|
--instance "${FORGEJO_URL:-http://forgejo:3000}" \
|
||||||
--name "${RUNNER_NAME:-$(hostname)}" \
|
--name "${RUNNER_NAME:-$(hostname)}" \
|
||||||
--secret "${FORGEJO_SECRET}" \
|
--secret "${FORGEJO_SECRET}" \
|
||||||
${CONFIG_ARG}\
|
${CONFIG_ARG} \
|
||||||
${EXTRA_ARGS} 2>&1 | tee /tmp/reg.log
|
${EXTRA_ARGS} 2>&1 | tee /tmp/reg.log
|
||||||
else
|
else
|
||||||
run_command forgejo-runner register \
|
run_command forgejo-runner register \
|
||||||
--instance "${FORGEJO_URL:-http://forgejo:3000}" \
|
--instance "${FORGEJO_URL:-http://forgejo:3000}" \
|
||||||
--name "${RUNNER_NAME:-$(hostname)}" \
|
--name "${RUNNER_NAME:-$(hostname)}" \
|
||||||
--token "${RUNNER_TOKEN}" \
|
--token "${RUNNER_TOKEN}" \
|
||||||
--no-interactive \
|
--no-interactive \
|
||||||
${CONFIG_ARG}\
|
${CONFIG_ARG} \
|
||||||
${EXTRA_ARGS} 2>&1 | tee /tmp/reg.log
|
${EXTRA_ARGS} 2>&1 | tee /tmp/reg.log
|
||||||
fi
|
fi
|
||||||
cat /tmp/reg.log | grep -E 'connection successful|registered successfully' >/dev/null
|
cat /tmp/reg.log | grep -E 'connection successful|registered successfully' >/dev/null
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
|
|
Loading…
Reference in a new issue