28 lines
919 B
Bash
28 lines
919 B
Bash
#!/bin/bash
|
|
|
|
# This is the start.sh file for the gitea-runner egg
|
|
|
|
# Only download and set up act_runner if it doesn't exist
|
|
if [ ! -f "act_runner" ]; then
|
|
echo "Downloading act_runner..."
|
|
curl -O https://dl.gitea.com/act_runner/0.2.13/act_runner-0.2.13-linux-amd64
|
|
mv act_runner-0.2.13-linux-amd64 act_runner
|
|
chmod +x act_runner
|
|
echo "act_runner downloaded and set up."
|
|
else
|
|
echo "act_runner already exists, skipping download."
|
|
fi
|
|
|
|
# Only register if the config file (.runner) doesn't exist
|
|
if [ ! -f "config.yml" ]; then
|
|
echo "Registering act_runner..."
|
|
curl -O
|
|
./act_runner generate-config > config.yaml register --instance ${INSTANCE_URL} --token ${RUNNER_TOKEN} --no-interactive
|
|
echo "Registration complete."
|
|
else
|
|
echo "Config file (.runner) already exists, skipping registration."
|
|
fi
|
|
|
|
# Always start the daemon
|
|
echo "Starting act_runner daemon..."
|
|
./act_runner daemon |