mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-23 03:05:48 +03:00
78 lines
2.6 KiB
Text
78 lines
2.6 KiB
Text
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
|
|
# Contributor: Rasmus Thomsen <oss@cogitir.dev>
|
|
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
|
|
pkgname=gitlab-runner
|
|
pkgver=14.1.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=8925d9a0
|
|
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
|
|
"
|
|
|
|
builddir="$srcdir/$pkgname-v$pkgver"
|
|
|
|
export GOPATH="$srcdir"
|
|
export CGO_ENABLED=0
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
# fix build on riscv64
|
|
go mod edit -replace \
|
|
github.com/kr/pty=github.com/creack/pty@v1.1.13
|
|
go mod tidy
|
|
}
|
|
|
|
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="
|
|
9dea3d3145e29160ed2e0088612fde75309091486f582c2252648ea01326bb7a3131cd6f1c5e30c76991968e1f74c90938f1d8f380f265c133e68b080f160947 gitlab-runner-v14.1.0.tar.gz
|
|
2ae753efc220c46378e84831f01b289f3689af70cd7cbb0bbcc04dc17c910d65eb5105c198d5a23098e27797a7d1c695f49b244993ea4676eb9ec9cda064f44e gitlab-runner.initd
|
|
243ed9d7575e925794213973232f95f02d5e10cfab6cd29df6a4641b9d05b342ae90678b2eea4b21ddc703596429919d037b38248046d7c5e7a480406f412445 gitlab-runner.confd
|
|
"
|