From 74d39bb0a5cb2cf2f604ce708a9b28c11b54cd7f Mon Sep 17 00:00:00 2001 From: sebthom Date: Fri, 28 Apr 2023 13:16:45 +0200 Subject: [PATCH] use `catthehacker/ubuntu:runner-***` images for default labels --- README.md | 2 +- image/Dockerfile | 4 ++++ image/run_runner.sh | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 06aeb9e..485060c 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ Name|Default Value|Description ----|-------------|----------- GITEA_INSTANCE_INSECURE|`false`|It `true` don't verify the TLS certificate of the Gitea instance GITEA_RUNNER_NAME|``|If not specified the container's hostname is used -GITEA_RUNNER_LABELS|``|Comma-separated list of labels (e.g. `ubuntu-20.04:docker://node:16-bullseye,ubuntu-18.04:docker://node:16-buster,linux_arm:host`) If not specified default labels are used +GITEA_RUNNER_LABELS|``|Comma-separated list of labels in the format of `label[:schema[:args]]`. If not specified the following labels are used `ubuntu-latest:docker://catthehacker/ubuntu:runner-22.04,ubuntu-22.04:docker://catthehacker/ubuntu:runner-22.04,ubuntu-20.04:docker://catthehacker/ubuntu:runner-20.04` GITEA_RUNNER_REGISTRATION_FILE|`/data/.runner`|The JSON file that holds the result from the runner registration with the Gitea instance GITEA_RUNNER_REGISTRATION_TIMEOUT|`30`|In case of failure, registration is retried until this timeout in seconds is reached GITEA_RUNNER_REGISTRATION_RETRY_INTERVAL|`5`|Wait period in seconds between registration retries diff --git a/image/Dockerfile b/image/Dockerfile index f5fa332..40d4840 100644 --- a/image/Dockerfile +++ b/image/Dockerfile @@ -131,6 +131,10 @@ ENV \ # GITEA_RUNNER_NAME='' \ GITEA_RUNNER_LABELS='' \ + GITEA_RUNNER_LABELS_DEFAULT='\ +ubuntu-latest:docker://catthehacker/ubuntu:runner-22.04,\ +ubuntu-22.04:docker://catthehacker/ubuntu:runner-22.04,\ +ubuntu-20.04:docker://catthehacker/ubuntu:runner-20.04' \ GITEA_RUNNER_UID=1000 \ GITEA_RUNNER_GID=1000 \ # diff --git a/image/run_runner.sh b/image/run_runner.sh index 5a6f244..9327899 100644 --- a/image/run_runner.sh +++ b/image/run_runner.sh @@ -59,6 +59,10 @@ if [[ ! -s .runner ]]; then read -r GITEA_RUNNER_REGISTRATION_TOKEN < "$GITEA_RUNNER_REGISTRATION_TOKEN_FILE" fi + if [[ -z ${GITEA_RUNNER_LABELS:-} ]]; then + GITEA_RUNNER_LABELS=$GITEA_RUNNER_LABELS_DEFAULT + fi + log INFO "Trying to register runner with Gitea..." log INFO " GITEA_INSTANCE_URL=$GITEA_INSTANCE_URL" log INFO " GITEA_RUNNER_NAME=$GITEA_RUNNER_NAME"