aboutsummaryrefslogtreecommitdiffstats
path: root/community/gitlab-runner/APKBUILD
blob: 1eab59d7b788a80636d14ddddbebc7c442d6153a (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
74
75
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Contributor: Rasmus Thomsen <oss@cogitir.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gitlab-runner
pkgver=13.8.0
pkgrel=0
# 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=775dd39d
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
	$pkgname.initd
	$pkgname.confd
	change-deps.patch
	fix-docker-linux-stat.patch
	"

builddir="$srcdir/$pkgname-v$pkgver"

export GOPATH="$srcdir"
export CGO_ENABLED=0

prepare() {
	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=$_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
		-s -w
		"
	# 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 "$builddir"/bin/gitlab-runner \
		"$pkgdir"/usr/bin/gitlab-runner

	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/gitlab-runner
	install -Dm644 "$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="b7e14763d621ba641f90383c9d92d4302c808c6f84c9c915851f30c28fd6aca264c9410e2a2bb9d6c43619f8537b1c80dfabc66a6023747e8f9024629bd6f0b9  gitlab-runner-v13.8.0.tar.gz
2ae753efc220c46378e84831f01b289f3689af70cd7cbb0bbcc04dc17c910d65eb5105c198d5a23098e27797a7d1c695f49b244993ea4676eb9ec9cda064f44e  gitlab-runner.initd
243ed9d7575e925794213973232f95f02d5e10cfab6cd29df6a4641b9d05b342ae90678b2eea4b21ddc703596429919d037b38248046d7c5e7a480406f412445  gitlab-runner.confd
b4ff8b577735df2905ba1cdc882e500315627504bdc82c7577b0cf2c0c59a62b2d92cb38c49093307900a11a9e1c67b717dc0bd6e728a00e8ee60df244cc4cbe  change-deps.patch
56b83d643062aeaa784fcf27e227a1f31b7e05df88ab8e900bc66916cef5eab35151c1dc2351187435838622dd58adb2c37b758afd13550cad42a171581dfa15  fix-docker-linux-stat.patch"