peppa/infra/act-runner/register.sh
Асель 3ab408eb70 PEP-57: CI for factory projects — act_runner, template workflow, connect CI
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 14:19:11 +05:00

16 lines
732 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 /etc/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"