add gateway automatic template and fefan vm

This commit is contained in:
2026-01-19 17:05:38 +01:00
parent d98c7b8bdb
commit f851ead7cd
56 changed files with 1243 additions and 82 deletions

View File

@@ -2,6 +2,16 @@
source /opt/bookshelf/env.sh
## .env should define
# ACT_RUNNER_USER: act_runner username (act_runner)
# ACT_RUNNER_LOCATION: act_runner binary location (/usr/local/bin)
# ACT_RUNNER_VERSION: act_runner version (0.2.13)
# ENV_FILE_LOCATION: .env file location on vm (/opt/bookshelf/bookshelf.env)
# GITEA_INSTANCE_URL: url of the gitea instance (https://gitea.aldon.fr)
# GITEA_RUNNER_REGISTRATION_TOKEN: registration token for gitea runner (repository scope)
# USERNAME: username of the vm (bookshelf)
# REPOSITORY: repository on which service code is hosted (mop/bookshelf)
if ! id -u $ACT_RUNNER_USER >/dev/null 2>&1; then
adduser \
--system \
@@ -30,9 +40,9 @@ runner:
fetch_interval: 2s
github_mirror: ''
labels:
- "ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest"
- "ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04"
- "ubuntu-20.04:docker://docker.gitea.com/runner-images:ubuntu-20.04"
- 'ubuntu-latest:docker://docker.gitea.com/runner-images:ubuntu-latest'
- 'ubuntu-22.04:docker://docker.gitea.com/runner-images:ubuntu-22.04'
- 'ubuntu-20.04:docker://docker.gitea.com/runner-images:ubuntu-20.04'
cache:
enabled: true
dir: ""
@@ -55,5 +65,5 @@ host:
EOF
cd /home/act_runner
sudo -u $ACT_RUNNER_USER act_runner register --no-interactive --instance $GITEA_INSTANCE_URL --token $GITEA_RUNNER_REGISTRATION_TOKEN --name $USERNAME --labels $USERNAME $REPOSITORY
sudo -u $ACT_RUNNER_USER act_runner register --no-interactive --instance $GITEA_INSTANCE_URL --token $GITEA_RUNNER_REGISTRATION_TOKEN --name $USERNAME --labels $USERNAME
chown -R $ACT_RUNNER_USER:docker /home/$ACT_RUNNER_USER