From fcee3fd99d407a5b08209ca4f90211ad2efaeb6b Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 1 Jun 2025 16:57:00 +1200 Subject: [PATCH] 'Generic Commit' --- gitea-runner/install.sh | 10 +++++++++- gitea-runner/start.sh | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gitea-runner/install.sh b/gitea-runner/install.sh index aed7696..d9195d0 100755 --- a/gitea-runner/install.sh +++ b/gitea-runner/install.sh @@ -14,7 +14,6 @@ chmod +x "${TEMP_DIR}/act_runner" || _die "Failed to download ${TEMP_DIR}/act_ru ACT_RUNNER="${GITEA_RUNNER_DIRECTORY}/act_runner" CONFIG_FILE="${GITEA_RUNNER_DIRECTORY}/config.yaml" - echo "Checking version..." mkdir -p "${GITEA_RUNNER_DIRECTORY}" || _die "Failed to create ${GITEA_RUNNER_DIRECTORY}" cp "${TEMP_DIR}/act_runner" "$ACT_RUNNER" || _die "Failed to copy ${TEMP_DIR}/act_runner to ${GITEA_RUNNER_DIRECTORY}/act_runner" @@ -25,6 +24,9 @@ if [ ! -f "${CONFIG_FILE}" ]; then echo "Generating config.yaml..." ${ACT_RUNNER} generate-config > "${CONFIG_FILE}" || _die "Failed to generate config.yaml" + # replace the " file: .runner" line with " file: ${GITEA_RUNNER_DIRECTORY}/registration" in config.yaml + sed -i "s|[[:space:]]*file:[[:space:]]*\.runner| file: ${GITEA_RUNNER_DIRECTORY}/registration|" "${CONFIG_FILE}" + echo "Registering runner..." ${ACT_RUNNER} --config "${CONFIG_FILE}" \ register --no-interactive \ @@ -36,6 +38,12 @@ else echo "Runner already registered." fi +[ -f "${CONFIG_FILE}" ] || _die "Failed to create ${CONFIG_FILE}" +[ -f "${ACT_RUNNER}" ] || _die "Failed to create ${ACT_RUNNER}" + +echo "CONFIG_FILE: ${CONFIG_FILE}" +echo "ACT_RUNNER: ${ACT_RUNNER}" + ./start.sh || _die "Failed to start" echo "Installation complete for service ${SERVICE}." diff --git a/gitea-runner/start.sh b/gitea-runner/start.sh index 914ee10..04f0dfb 100755 --- a/gitea-runner/start.sh +++ b/gitea-runner/start.sh @@ -9,8 +9,8 @@ _check_required_env_vars "SERVER" "SERVICE" "GITEA_RUNNER_DIRECTORY" # It is used to start the service on the server. # It is called with the path to the server specific env file as an argument. -CONFIG_FILE="${GITEA_RUNNER_DIRECTORY}/config.yaml" ACT_RUNNER="${GITEA_RUNNER_DIRECTORY}/act_runner" +CONFIG_FILE="${GITEA_RUNNER_DIRECTORY}/config.yaml" echo "Starting act_runner..." "${ACT_RUNNER}" daemon --config "${CONFIG_FILE}" >/dev/null 2>&1 &