Add gitlab-runner helpers/template

This commit is contained in:
selfhoster selfhoster 2023-06-06 12:48:59 +02:00
commit 0fc31dfa56
5 changed files with 89 additions and 1 deletions

14
bin/gitlab-runner-helper.sh Executable file
View file

@ -0,0 +1,14 @@
#! /usr/bin/env bash
echo "Waiting for network to come online..."
while ! ping -c 1 google.fr ; do
sleep 1
done
pacman -Sy
pacman --noconfirm -S gitlab-runner docker
ln -sf /etc/gitlab-runner.toml /etc/gitlab-runner/config.toml
systemctl enable gitlab-runner docker
systemctl start docker
systemctl restart gitlab-runner

14
bin/gitlab-runner.sh Executable file
View file

@ -0,0 +1,14 @@
#! /usr/bin/env bash
if [ $# -lt 1 ]; then
echo "gitlab-runner.sh CONFIG"
echo " where CONFIG is a /etc/gitlab-runner/config.toml file"
exit 1
fi
if [ ! -f "$1" ]; then
echo "WRONG CONFIG FILE: "$1""
exit 1
fi
mkvm.sh -k --copy "$1" /etc/gitlab-runner.toml --copy /usr/sbin/gitlab-runner-helper.sh /usr/sbin/gitlab-runner-helper.sh gitlab-runner /usr/sbin/gitlab-runner-helper.sh