From 1513acf12d026f775d592df9115c85924a84c669 Mon Sep 17 00:00:00 2001 From: caes Date: Fri, 29 May 2020 03:16:24 -0400 Subject: [PATCH] Added function to register gitlab runners. --- broker.sh | 18 ++++++++++++++++++ data.json | 23 ++++++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/broker.sh b/broker.sh index c464aa2..8821bd4 100755 --- a/broker.sh +++ b/broker.sh @@ -650,6 +650,24 @@ git_list_dirs_under () { ###################################################################### # Gitlab operations +# $1: gitlab token +gitlab_runner_register_on_host () { + #docker run --rm -t -i -v \ + # /srv/gitlab-runner/config:/etc/gitlab-runner \ + docker run --rm -v /srv/gitlab-runner/config:/etc/gitlab-runner \ + gitlab/gitlab-runner register \ + --non-interactive \ + --executor "docker" \ + --docker-image alpine:latest \ + --url "https://gitlab.adamo.network" \ + --registration-token "$1" \ + --description "adamocomp-runner" \ + --tag-list "docker,adamocomp" \ + --run-untagged="true" \ + --locked="false" \ + --access-level="not_protected" +} + gitlab_download_backups () { scp rancher@gitlab.adamo.network:~/* . } diff --git a/data.json b/data.json index fc36346..a3f5c87 100644 --- a/data.json +++ b/data.json @@ -28,7 +28,7 @@ ] }, "gitlab": { - "repo": "sys/adamocomp.git", + "repo": "GITLABREPO.git", "docker": { "issue_path": "/opt/gitlab", "image": "gitlab/gitlab-ce:latest", @@ -60,6 +60,27 @@ "Running as a bootstrap." ] }, + "gitlab-runner": { + "repo": "GITLABRUNNERREPO.git", + "docker": { + "issue_path": "/opt/gitlab-runner", + "image": "gitlab/gitlab-runner:latest", + "options": [ + [ + "--rm" + ], + [ + "--volume", + "/srv/gitlab-runner/config:/etc/gitlab-runner", + "/var/run/docker.sock:/var/run/docker.sock" + ], + ["--restart","always"] + ] + }, + "suggest": [ + "Can't reach the volumes?" + ] + }, "asciiflow": { "repo": "apps/asciiflow.git", "docker": {