2025-06-01 16:57:00 +12:00

29 lines
795 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
# shellcheck disable=SC1091
source "${AGENT_PATH}/common.sh"
_check_required_env_vars "SERVER" "SERVICE" "GITEA_RUNNER_DIRECTORY"
# START SCRIPT
# The start script is required for all templates.
# 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.
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 &
# Add a short delay to allow the background process to start
sleep 2
if pgrep -f "${ACT_RUNNER}" > /dev/null; then
echo "act_runner started successfully."
else
_die "Failed to start act_runner process."
fi
echo "Started $SERVICE"