Last active
March 30, 2020 15:59
-
-
Save hoegaarden/4c3baea64981eeffc75fa4d466862da5 to your computer and use it in GitHub Desktop.
install github runner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
set -u | |
set -o pipefail | |
readonly RUNNER_URL='https://github.com/actions/runner/releases/download/v2.165.2/actions-runner-linux-x64-2.165.2.tar.gz' | |
main() { | |
local org="${1}" | |
local repo="${2}" | |
local name="${3}" | |
local token="${4}" | |
local dir='/var/lib/github-runner' | |
export RUNNER_ALLOW_RUNASROOT=1 | |
mkdir -p "${dir}" | |
cd "${dir}" | |
curl -L "${RUNNER_URL}" | tar -xzf - | |
./bin/installdependencies.sh | |
[ -e ./svc.sh ] || { | |
./config.sh --unattended --url "https://github.com/${org}/${repo}" --token "${token}" --name "${name}" --replace | |
} | |
./svc.sh install | |
./svc.sh start | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment