forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: William Hubbs <[email protected]>
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Copyright 1999-2022 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
inherit go-module systemd tmpfiles | ||
|
||
# make sure this gets updated for every bump | ||
GIT_COMMIT=bbcb5aba7 | ||
|
||
DESCRIPTION="The official GitLab Runner, written in Go" | ||
HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-runner" | ||
SRC_URI="https://gitlab.com/gitlab-org/gitlab-runner/-/archive/v${PV}/${PN}-v${PV}.tar.gz -> ${P}.tar.gz" | ||
SRC_URI+=" https://dev.gentoo.org/~williamh/dist/${P}-deps.tar.xz" | ||
|
||
LICENSE="MIT" | ||
SLOT="0" | ||
KEYWORDS="~amd64" | ||
|
||
COMMON_DEPEND="acct-group/gitlab-runner | ||
acct-user/gitlab-runner" | ||
DEPEND="${COMMON_DEPEND}" | ||
RDEPEND="${COMMON_DEPEND}" | ||
BDEPEND="dev-go/gox" | ||
|
||
DOCS=( docs CHANGELOG.md README.md config.toml.example ) | ||
|
||
PATCHES=( | ||
# https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/3498 | ||
"${FILESDIR}"/build-for-arm64.patch | ||
) | ||
|
||
S="${WORKDIR}/${PN}-v${PV}" | ||
|
||
src_compile() { | ||
emake \ | ||
BUILT="$(date -u '+%Y-%m-%dT%H:%M:%S%:z')" \ | ||
GOX="${EPREFIX}/usr/bin/gox" \ | ||
REVISION=${GIT_COMMIT} \ | ||
VERSION=${PV} \ | ||
runner-bin-host | ||
} | ||
|
||
src_test() { | ||
CI=0 ego test | ||
} | ||
|
||
src_install() { | ||
dobin out/binaries/gitlab-runner | ||
einstalldocs | ||
|
||
newconfd "${FILESDIR}/${PN}.confd" "${PN}" | ||
newinitd "${FILESDIR}/${PN}.initd" "${PN}" | ||
systemd_dounit "${FILESDIR}/${PN}.service" | ||
newtmpfiles "${FILESDIR}"/${PN}.tmpfile ${PN}.conf | ||
keepdir /{etc,var/log}/${PN} | ||
fowners gitlab-runner:gitlab-runner /{etc,var/log}/${PN} | ||
fperms 0700 /{etc,var/log}/gitlab-runner | ||
} | ||
|
||
pkg_postinst() { | ||
tmpfiles_process gitlab-runner.conf | ||
[[ -f ${EROOT}/etc/gitlab-runner/config.toml ]] && return | ||
elog | ||
elog "To use the runner, you need to register it with this command:" | ||
elog "# gitlab-runner register" | ||
elog "This will also create the configuration file in /etc/gitlab-runner/config.toml" | ||
} |