aboutsummaryrefslogtreecommitdiffstats
path: root/community/gitlab-runner
diff options
context:
space:
mode:
authorKevin Daudt <kdaudt@alpinelinux.org>2019-08-20 16:27:08 +0000
committerKevin Daudt <kdaudt@alpinelinux.org>2019-08-20 16:27:17 +0000
commit8964bea8df421bfa5f13ed576159e3af6223f81f (patch)
tree2523eb9c334840152e98114fdeff07c6ee170d2d /community/gitlab-runner
parentba4b80258f4bfb90da9667a29d3e2ebe7849d0c1 (diff)
downloadaports-8964bea8df421bfa5f13ed576159e3af6223f81f.tar.bz2
aports-8964bea8df421bfa5f13ed576159e3af6223f81f.tar.xz
community/gitlab-runner: move from testing
Diffstat (limited to 'community/gitlab-runner')
-rw-r--r--community/gitlab-runner/APKBUILD65
-rw-r--r--community/gitlab-runner/gitlab-runner.confd7
-rw-r--r--community/gitlab-runner/gitlab-runner.initd14
-rw-r--r--community/gitlab-runner/gitlab-runner.pre-install6
l---------community/gitlab-runner/gitlab-runner.pre-upgrade1
5 files changed, 93 insertions, 0 deletions
diff --git a/community/gitlab-runner/APKBUILD b/community/gitlab-runner/APKBUILD
new file mode 100644
index 0000000000..bb6bb8525d
--- /dev/null
+++ b/community/gitlab-runner/APKBUILD
@@ -0,0 +1,65 @@
+# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
+# Contributor: Rasmus Thomsen <oss@cogitir.dev>
+# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
+pkgname=gitlab-runner
+pkgver=12.1.0
+pkgrel=1
+pkgdesc="GitLab runner for CI/CD jobs"
+url="https://docs.gitlab.com/runner/"
+arch="all"
+license="MIT"
+makedepends="go"
+install="$pkgname.pre-install $pkgname.pre-upgrade"
+pkgusers="gitlab-runner"
+pkggroups="gitlab-runner"
+options="!check" # Need to be run in a git repo
+subpackages="$pkgname-helper $pkgname-openrc"
+source="https://gitlab.com/gitlab-org/gitlab-runner/-/archive/v$pkgver/gitlab-runner-v$pkgver.tar.gz
+ $pkgname.initd
+ $pkgname.confd"
+
+builddir="$srcdir/src/gitlab.com/gitlab-org/$pkgname"
+
+export GOPATH="$srcdir"
+export CGO_ENABLED=0
+
+prepare() {
+ mkdir -p ${builddir%/*}
+ mv "$srcdir"/$pkgname-v$pkgver "$builddir"/
+ default_prepare
+}
+
+build() {
+ local ldflags="
+ -X gitlab.com/gitlab-org/$pkgname/common.NAME=$pkgname
+ -X gitlab.com/gitlab-org/$pkgname/common.VERSION=$pkgver
+ -X gitlab.com/gitlab-org/$pkgname/common.REVISION=unknown
+ -X gitlab.com/gitlab-org/$pkgname/common.BUILT=$(date -u +%Y-%m-%dT%H:%M:%S%z)
+ -X gitlab.com/gitlab-org/$pkgname/common.BRANCH=unknown
+ -s -w
+ "
+ go build -ldflags "$ldflags" -o bin/gitlab-runner
+ go build -ldflags "$ldflags" -o bin/gitlab-runner-helper \
+ ./apps/gitlab-runner-helper
+}
+
+package() {
+ install -Dm755 "$builddir"/bin/gitlab-runner \
+ "$pkgdir"/usr/bin/gitlab-runner
+
+ install -m755 -D "$srcdir/$pkgname.initd" "$pkgdir"/etc/init.d/gitlab-runner
+ install -m755 -D "$srcdir/$pkgname.confd" "$pkgdir"/etc/conf.d/gitlab-runner
+
+ mkdir -p "$pkgdir"/var/lib/gitlab-runner
+ chown gitlab-runner:gitlab-runner "$pkgdir"/var/lib/gitlab-runner
+}
+
+helper() {
+ pkgdesc="$pkgdesc (helper)"
+ install -Dm755 "$builddir"/bin/gitlab-runner-helper \
+ "$subpkgdir"/usr/bin/gitlab-runner-helper
+}
+
+sha512sums="1b3f06b7000252631bec04a58474dda826b0fb8d28c4144051a231fba5ef0c5c4b6e0f9ca6bdf9bf9b16b9117cbcf6385eb7bac85bda7b9f99de4300cbcc2066 gitlab-runner-v12.1.0.tar.gz
+2ae753efc220c46378e84831f01b289f3689af70cd7cbb0bbcc04dc17c910d65eb5105c198d5a23098e27797a7d1c695f49b244993ea4676eb9ec9cda064f44e gitlab-runner.initd
+243ed9d7575e925794213973232f95f02d5e10cfab6cd29df6a4641b9d05b342ae90678b2eea4b21ddc703596429919d037b38248046d7c5e7a480406f412445 gitlab-runner.confd"
diff --git a/community/gitlab-runner/gitlab-runner.confd b/community/gitlab-runner/gitlab-runner.confd
new file mode 100644
index 0000000000..98c3f285de
--- /dev/null
+++ b/community/gitlab-runner/gitlab-runner.confd
@@ -0,0 +1,7 @@
+# Extra options passed to 'gitlab-runner run'
+GITLAB_RUNNER_OPTS="--config /etc/gitlab-runner/config.toml --working-directory /var/lib/gitlab-runner --service gitlab-runner"
+
+# Change to root if you want to run a system instance instead of a user one
+GITLAB_RUNNER_USER="gitlab-runner"
+# Same as above
+GITLAB_RUNNER_GROUP="gitlab-runner"
diff --git a/community/gitlab-runner/gitlab-runner.initd b/community/gitlab-runner/gitlab-runner.initd
new file mode 100644
index 0000000000..f0659a7ad3
--- /dev/null
+++ b/community/gitlab-runner/gitlab-runner.initd
@@ -0,0 +1,14 @@
+#!/sbin/openrc-run
+
+supervisor=supervise-daemon
+
+description="GitLab CI Runner"
+name="Gitlab Runner"
+
+command="/usr/bin/gitlab-runner"
+command_args="run ${GITLAB_RUNNER_OPTS}"
+command_user="${GITLAB_RUNNER_USER}:${GITLAB_RUNNER_GROUP}"
+
+depend() {
+ need net
+}
diff --git a/community/gitlab-runner/gitlab-runner.pre-install b/community/gitlab-runner/gitlab-runner.pre-install
new file mode 100644
index 0000000000..1a1fd67f3c
--- /dev/null
+++ b/community/gitlab-runner/gitlab-runner.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S gitlab-runner 2>/dev/null
+adduser -S -D -H -h /var/lib/gitlab-runner -s /sbin/nologin -G gitlab-runner -g gitlab-runner gitlab-runner 2>/dev/null
+
+exit 0
diff --git a/community/gitlab-runner/gitlab-runner.pre-upgrade b/community/gitlab-runner/gitlab-runner.pre-upgrade
new file mode 120000
index 0000000000..c4c1beb8b5
--- /dev/null
+++ b/community/gitlab-runner/gitlab-runner.pre-upgrade
@@ -0,0 +1 @@
+gitlab-runner.pre-install \ No newline at end of file