support for organization runners

This commit is contained in:
Reinier Timmer
2020-04-23 16:36:40 +02:00
parent d1429beaa6
commit fb35dd4131
12 changed files with 236 additions and 61 deletions

View File

@@ -5,18 +5,24 @@ if [ -z "${RUNNER_NAME}" ]; then
exit 1
fi
if [ -z "${RUNNER_REPO}" ]; then
echo "RUNNER_REPO must be set" 1>&2
if [ -z "${RUNNER_ORG}" ]; then
echo "RUNNER_ORG must be set" 1>&2
exit 1
fi
ATTACH="${RUNNER_ORG}"
if [ ! -z "${RUNNER_REPO}" ]; then
ATTACH="${RUNNER_ORG}/${RUNNER_REPO}"
fi
if [ -z "${RUNNER_TOKEN}" ]; then
echo "RUNNER_TOKEN must be set" 1>&2
exit 1
fi
cd /runner
./config.sh --unattended --replace --name "${RUNNER_NAME}" --url "https://github.com/${RUNNER_REPO}" --token "${RUNNER_TOKEN}"
./config.sh --unattended --replace --name "${RUNNER_NAME}" --url "https://github.com/${ATTACH}" --token "${RUNNER_TOKEN}"
unset RUNNER_NAME RUNNER_REPO RUNNER_TOKEN
exec ./run.sh --once