Add an install script for runner and a runner script.

This commit is contained in:
Cyteen May 2020-02-18 20:33:14 +00:00
parent dae04f161b
commit 6963402223
3 changed files with 48 additions and 1 deletions

20
020_gitlab-runner.sh Normal file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
apt-get install -y curl apt-transport-https gnupg
OS=debian
DIST=stretch
GPG_KEY_URL="https://packages.gitlab.com/runner/gitlab-runner/gpgkey"
cat > /etc/apt/sources.list-available/runner_gitlab-runner.list <<EOF
deb https://packages.gitlab.com/runner/gitlab-runner/${OS}/ ${DIST} main
deb-src https://packages.gitlab.com/runner/gitlab-runner/${OS}/ ${DIST} main
EOF
ln -s /etc/apt/sources.list-available/runner_gitlab-runner.list /etc/apt/sources.list.d/runner_gitlab-runner.list
curl -L "${GPG_KEY_URL}" 2> /dev/null | apt-key add - &>/dev/null
apt-get update
apt-get install -y gitlab-runner

View File

@ -6,4 +6,20 @@ conflict with git-buildpackage, so this image should help things.
It should also provide a local cache of the base packages needed to
run git-buildpackage builds.
Change the image name in build.sh to create a local image.
Change the image name in build.sh to create a local docker image
Run 020_gitlab-runner.sh to install gitlab-runner.
Change the GITLAB_URL and CI_TOKEN in gitlab-ci-runner.sh to point to your project.
The settings are found on the project page settings -> CI / CD -> Runners
under 'Set up a specific Runner manually'
https://git.devuan.org/${USERNAME}/${PROJECT}/settings/ci_cd
GITLAB_URL=https://git.devuan.org/
CI_TOKEN={UNIQUE_IDENTIFIER}
Run gitlab-ci-runner.sh

11
gitlab-ci-runner.sh Normal file
View File

@ -0,0 +1,11 @@
GITLAB_URL=http://git.devuan.org/cyteen/bluealsa
CI_TOKEN=2hfzsf2Egy1_z9MjnBJb
gitlab-ci-multi-runner register \
--non-interactive \
--url "$(GITLAB_URL)" \
--registration-token "$(CI_TOKEN)" \
--description "Generic devuan beowulf package build runner" \
--executor "docker" \
--docker-image "cyteen/generic-package-build-runner:v1"