mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 17:09:10 -07:00
dev-util/gitlab-runner: initial import
Signed-off-by: William Hubbs <williamh@gentoo.org>
This commit is contained in:
2
dev-util/gitlab-runner/Manifest
Normal file
2
dev-util/gitlab-runner/Manifest
Normal file
@@ -0,0 +1,2 @@
|
||||
DIST gitlab-runner-14.9.1-deps.tar.xz 142907928 BLAKE2B fb61c7b03d3dd63196bb4de0042a3c65035a3fc132435d7844635bb968a6bfe43e05fca053bfa96ba22cc9fd601d533857bffdf8bd734e90e86fefce8091da34 SHA512 d077cc1220ad33196655e578937c910c7b368eef57bb96d385eac0957e5f8902bb3720b1614f3179753929f25589a8d1d543bcb61d4cf5972bf4ada96a4056d8
|
||||
DIST gitlab-runner-14.9.1.tar.gz 1259997 BLAKE2B a4694198630fb2cc47ad4e9fe36b366ae695d8a4618e755b9ff12b608d5d8266614cc649b0e63bca125919ebe8dd40859fc7804cd8bb40ed391a54d6ae65a325 SHA512 ec804f3a4982414d52a4f3b5ff1560c5342a3650f1bb3edefa211a3810b17e202263abc67bfcd4423fe88b5acd501da1d23f3980a078800ab25932625ff75bc5
|
||||
19
dev-util/gitlab-runner/files/gitlab-runner.confd
Normal file
19
dev-util/gitlab-runner/files/gitlab-runner.confd
Normal file
@@ -0,0 +1,19 @@
|
||||
# config file for /etc/init.d/gitlab-runner
|
||||
# The convention is that the defaults are shown here, commented out.
|
||||
# Do not override these unless you know exactly what you are doing.
|
||||
|
||||
# runner_config="/etc/gitlab-runner/config.toml"
|
||||
# runner_datadir="/var/lib/gitlab-runner"
|
||||
# runner_service="${RC_SVCNAME}"
|
||||
# runner_user="gitlab-runner"
|
||||
|
||||
# Additional options
|
||||
# run /usr/bin/gitlab-runner -h to see available options
|
||||
# --config, --user, --service and --working-directory are set by the
|
||||
# above variables, so do not add them here.
|
||||
# RUNNER_OPTS=""
|
||||
|
||||
# Logging
|
||||
# runner_logdir="/var/log/gitlab-runner"
|
||||
# output_log="${runner_logdir}/gitlab-runner.log"
|
||||
# error_log="${runner_logdir}/error.log"
|
||||
35
dev-util/gitlab-runner/files/gitlab-runner.initd
Normal file
35
dev-util/gitlab-runner/files/gitlab-runner.initd
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2018 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
command="/usr/bin/gitlab-runner"
|
||||
command_args="run
|
||||
--config ${runner_config:-/etc/gitlab-runner/config.toml}
|
||||
--service ${runner_service:-${RC_SVCNAME}}
|
||||
--user ${runner_user:-gitlab-runner}
|
||||
--working-directory ${runner_datadir:-/var/lib/gitlab-runner}
|
||||
${RUNNER_OPTS}"
|
||||
command_background=true
|
||||
extra_started_commands="reload"
|
||||
name="${name:-GitLab Runner}"
|
||||
pidfile="/run/${RC_SVCNAME}.pid"
|
||||
output_log="${output_log:-${runner_logdir}/gitlab-runner.log"
|
||||
error_log="${error_log:-${runner_logdir}/gitlab-runner.err"
|
||||
retry="QUIT/60/TERM/60"
|
||||
required_files="${runner_config}"
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
after net.lo loopback
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath -d -m 0700 -o "${runner_user}" "${runner_datadir}"
|
||||
checkpath -d -m 0750 -o "${runner_user}" "${runner_logdir}"
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "Reloading ${name} configuration"
|
||||
start-stop-daemon --signal HUP --pidfile "${pidfile}"
|
||||
eend $? "Failed to reload ${name}"
|
||||
}
|
||||
18
dev-util/gitlab-runner/files/gitlab-runner.service
Normal file
18
dev-util/gitlab-runner/files/gitlab-runner.service
Normal file
@@ -0,0 +1,18 @@
|
||||
[Unit]
|
||||
Description=GitLab Runner service
|
||||
After=syslog.target network.target
|
||||
ConditionFileIsExecutable=/usr/bin/gitlab-runner
|
||||
|
||||
[Service]
|
||||
StartLimitInterval=5
|
||||
StartLimitBurst=10
|
||||
ExecStart=/usr/bin/gitlab-runner run -c /etc/gitlab-runner/config.toml -u gitlab-runner -d /var/lib/gitlab-runner --syslog
|
||||
Restart=always
|
||||
RestartSec=120
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
SyslogIdentifier=gitlab-runner
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
1
dev-util/gitlab-runner/files/gitlab-runner.tmpfile
Normal file
1
dev-util/gitlab-runner/files/gitlab-runner.tmpfile
Normal file
@@ -0,0 +1 @@
|
||||
d /run/gitlab-runner 0755 gitlab-runner gitlab-runner
|
||||
60
dev-util/gitlab-runner/gitlab-runner-14.9.1.ebuild
Normal file
60
dev-util/gitlab-runner/gitlab-runner-14.9.1.ebuild
Normal file
@@ -0,0 +1,60 @@
|
||||
# Copyright 1999-2022 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
inherit go-module systemd tmpfiles
|
||||
GIT_COMMIT=bd40e3da
|
||||
|
||||
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 )
|
||||
|
||||
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() {
|
||||
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"
|
||||
}
|
||||
12
dev-util/gitlab-runner/metadata.xml
Normal file
12
dev-util/gitlab-runner/metadata.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>williamh@gentoo.org</email>
|
||||
<name>William Hubbs</name>
|
||||
</maintainer>
|
||||
<maintainer type="project">
|
||||
<email>infra@gentoo.org</email>
|
||||
<name>Gentoo Infrastructure Project</name>
|
||||
</maintainer>
|
||||
</pkgmetadata>
|
||||
Reference in New Issue
Block a user