aboutsummaryrefslogtreecommitdiffstats
path: root/community/gitlab-runner/APKBUILD
blob: 1520f33caf9def2a0858b6afef5251d87bb6c856 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Contributor: Rasmus Thomsen <oss@cogitir.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gitlab-runner
pkgver=15.3.0
pkgrel=2
# first 8 chars of the git hash of the release, see
# https://gitlab.com/gitlab-org/gitlab-runner/-/tags
# PLEASE update this, since they're used to determine what version of
# https://hub.docker.com/r/gitlab/gitlab-runner-helper/tags to use
_rev=bbcb5aba
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 chmod-clean" # 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
	allow-disable-colors-in-log.patch
	$pkgname.initd
	$pkgname.confd
	$pkgname.logrotate
	"
builddir="$srcdir/$pkgname-v$pkgver"

export CGO_ENABLED=0
export GOCACHE="$srcdir/go-cache"
export GOTMPDIR="$srcdir"
export GOMODCACHE="$srcdir/go"

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=$_rev
		-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=master
		"
	# required for github.com/docker/docker
	export GO111MODULE=auto
	go build -ldflags "$ldflags" -o bin/gitlab-runner
	go build -ldflags "$ldflags" -o bin/gitlab-runner-helper \
		./apps/gitlab-runner-helper
}

package() {
	install -Dm755 bin/gitlab-runner -t "$pkgdir"/usr/bin/

	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.logrotate "$pkgdir"/etc/logrotate.d/$pkgname

	install -d -m750 -o "$pkgusers" -g "$pkggroups" "$pkgdir"/etc/$pkgname
	install -d -m700 -o "$pkgusers" -g "$pkggroups" "$pkgdir"/var/lib/$pkgname
}

helper() {
	pkgdesc="$pkgdesc (helper)"

	install -Dm755 "$builddir"/bin/gitlab-runner-helper -t "$subpkgdir"/usr/bin/
}

sha512sums="
8eabe9a4fd04e46d4bf306dc202664e29f5cb12cba5d73820888957d694711702e026f79a84e1d5f5237cb3d1e7efed8e035129814dcc6354e708ee98e98cbe9  gitlab-runner-v15.3.0.tar.gz
f98a84c10aaebd7cb3c487ae02df17d00f6938aba5e175061220ee1a3cd583a4a4a9abb263cb50556a7170e069c41e623eb94f4696f192429b557bd6827383f6  allow-disable-colors-in-log.patch
8b987e5f9464fe64059eb5300287c06a2d94c5a075db2663dd0bf5c9b6f053f26fcbe5c7d7959563aeca041bf6f006e998f0c46d25e978c4e52a1df4feb31466  gitlab-runner.initd
a80a1811099f353c4511d1ff9a2f674ce8f9254d460304aa2d66bcc258da2a979033316260663a4745be807d8891895572e5220eabc702230b69e92de4f78205  gitlab-runner.confd
2ddd42622b72135a95ac1c09061b61e73c4f89d4f0a86d1a3c902760d4a5f2c749a04f2d81568c973c83b1aae60ada71360a6bf74a31f8e5d9b10b90af4cdcfe  gitlab-runner.logrotate
"