summaryrefslogblamecommitdiff
path: root/user/gitlab-runner/APKBUILD
blob: c5b01bd3b9447f06028a9e25573889d4b6cbb08b (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                         
                     

             




                                            

                                          











                                                                                                    

                          





                                    







                                                                         




                                                                              




















                                                                     
                                      











                                                          
                                                                                                                                                                          

                                                                                                                                                             
                                                                                                                                                     


                                                                                                                                                    
# Contributor: Max Rees <maxcrees@me.com>
# Maintainer: Zach van Rijn <me@zv.io>
pkgname=gitlab-runner
pkgver=15.0.0
pkgrel=0
_testver=91956efe
_branch="${pkgver%.*}"
_branch="${pkgver%%.*}-${_branch#*.}-stable"
pkgdesc="GitLab runner for CI/CD jobs"
url="https://docs.gitlab.com/runner/"
# golang.org packages do not support ppc32
arch="all !ppc"
pkgusers="gitlab-runner"
pkggroups="gitlab-runner"
options="!check"  # Tests require network (git cloning)
license="MIT"
depends=""
makedepends="gcc-go"
subpackages="$pkgname-openrc"
install="$pkgname.pre-install"
source="https://gitlab.com/gitlab-org/gitlab-runner/-/archive/v$pkgver/gitlab-runner-v$pkgver.tar.gz
	https://dev.sick.bike/dist/gitlab-test-$_testver.tar.gz
	$pkgname.confd
	$pkgname.initd
	disable-crap.patch
	gccgo.patch
	tests.patch
	"
builddir="$srcdir/$pkgname-v$pkgver"

unpack() {
	default_unpack
	mv gitlab-test "$builddir"/tmp
}

_make() {
	make "$@" VERSION="$pkgver" REVISION="v$pkgver" BRANCH="$_branch"
}

build() {
	export GO111MODULE=on
	export GOCACHE="$builddir"/tmp/go-build
	export GOMODCACHE="$builddir"/go-mod
	export GOFLAGS="-buildvcs=false -p=$JOBS -v -mod=readonly -modcacherw"
	go build -o gitlab-runner .
}

check() {
	# Even with network access and a clean chroot, there are some
	# tests that fail:
	#
	# gitlab.com/gitlab-org/gitlab-runner/commands/helpers :
	# TestCacheArchiverAddingUntrackedFiles
	# TestCacheArchiverAddingUntrackedUnicodeFiles

	# gitlab.com/gitlab-org/gitlab-runner/executors/shell :
	# TestBuildWithGitStrategyFetchWithLFS
	# TestBuildWithGitStrategyCloneWithLFS
	# TestBuildWithSubmoduleLFSPullsLFSObject
	#
	# gitlab.com/gitlab-org/gitlab-runner/network (error: use of
	# undefined type ‘RegisterRunnerParameters’)
	_make test
}

package() {
	install -Dm755 gitlab-runner \
		"$pkgdir"/usr/bin/gitlab-runner
	install -dm750 -g gitlab-runner \
		"$pkgdir"/etc/gitlab-runner
	install -dm750 -o gitlab-runner -g gitlab-runner \
		"$pkgdir"/var/lib/gitlab-runner

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

sha512sums="8ba54e690fc45c1e22d174b649fbe3cf78707fd5a146c738c73cba045e6ac00499ddedd7a5f905c0c7e4e804a533d3fc718f8f7ac3c9ec5581de4dd9b3599c80  gitlab-runner-v15.0.0.tar.gz
7bccab81aa1cb88c6a0f83a6d3dfc509e6f9ecb4d0168a5b30cc4e8fdd823294b95fe3633e09757905466f83bb3bf73b1d28fac475dff2dc3164604db4b5b995  gitlab-test-91956efe.tar.gz
f8a0c7e77cd563d7e5b4fb2319181ceab8de44c555cefa4803e985ad3ac6a9fea7bca469d80b28974edcfb65f2095d019bfdf0abd8a3221464276a8d89debc0d  gitlab-runner.confd
7f785a65b46919f6a6695e25fdc414ee3204eb9aa1a3735e7884575434af94b20a48f2fe7a1fb787473de23a7bd2d56bc1e9c1fc6b522c6f0c05c47b3d37ab1c  gitlab-runner.initd
020a388f63758ecbcdd19ce3a290d2fd044e852174b6b7e1c79dc39d8d83ac161be5b63df8a9c60da315895e5385e9ac02bd3a46e02d45b96b8f939c90c444cd  disable-crap.patch
6bb477d2f40e651cb59f18ea18cfb051dd06cdfa3f976c6e17b72ee35733e9520a6323cec1f6b34d85fa46050b97bd20d4bb0f08a44f2cbfd4eb6914cfd5d604  gccgo.patch
9b64665ec4c7f0edb7151b146666ea22283ac109193ff354510da018f14f1442c99707c753e5185caed2eb034600aa93ef5c95d960443339db89696acef96c3c  tests.patch"