Skip to content

Commit

Permalink
Merge pull request #3 from XenitAB/fix/ghrunner
Browse files Browse the repository at this point in the history
Fix/ghrunner
  • Loading branch information
simongottschlag authored Dec 7, 2020
2 parents cdc2e58 + 7171cd6 commit 1e8b47e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[Unit]
Description=github-runner-start
After=network.target
StartLimitIntervalSec=120s
StartLimitBurst=3

[Service]
Type=oneshot
Type=simple
Restart=on-failure
RestartSec=30s
WorkingDirectory=/etc/github-runner
ExecStart=/etc/github-runner/github-runner.sh --action=REGISTER

Expand Down
3 changes: 3 additions & 0 deletions templates/azure/github-runner/files/github-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ if [[ "${ACTION}" == "REGISTER" ]]; then
useradd -s /bin/bash -d /home/ghrunner/ -m ghrunner
fi

usermod -a -G sudo,docker ghrunner
echo "ghrunner ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers.d/ghrunner

chown -R ghrunner:ghrunner /etc/github-runner

runuser -l ghrunner -c "${GITHUB_RUNNER_CONFIG_SCRIPT} --url https://github.com/${GITHUB_RUNNER_ORGANIZATION} --token ${GITHUB_RUNNER_REGISTER_TOKEN} --name $(hostname) --work /home/ghrunner --unattended --replace"
Expand Down

0 comments on commit 1e8b47e

Please sign in to comment.