peppa/infra/act-runner/register.sh
2026-11-16 15:54:13 +05:00

16 lines
734 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
# peppa-runner-register <имя> (токен регистрации — в переменной PEPPA_RUNNER_TOKEN)
# Регистрирует раннер в /data/runners/<имя>/; supervise.sh запустит его демона.
set -eu
name="$1"
case "$name" in *[!a-zA-Z0-9._-]*|"") echo "bad name: $name" >&2; exit 2;; esac
: "${PEPPA_RUNNER_TOKEN:?PEPPA_RUNNER_TOKEN is required}"
d="/data/runners/$name"
mkdir -p "$d"
cd "$d"
rm -f .runner .pid
act_runner register --no-interactive --config /peppa/act-runner/config.yaml \
--instance "$GITEA_INSTANCE_URL" --token "$PEPPA_RUNNER_TOKEN" --name "peppa-$name" \
--labels "peppa-trusted:docker://gitea/runner-images:ubuntu-latest"
echo "registered peppa-$name"