Merge branch '121-gitlab-runner-v10-0-2' into 'master'

Resolve "gitlab-runner-v10.0.2"

Closes #121

See merge request !200
This commit is contained in:
Manuel Friedli 2017-11-05 02:07:34 +01:00
commit 8fb7319280
7 changed files with 169 additions and 0 deletions

View File

@ -0,0 +1,7 @@
*gitlab-runner-10.0.2 (05 Nov 2017)
05 Nov 2017; Manuel Friedli <manuel@fritteli.ch>
+files/gitlab-runner-10.0.2.conf, +files/gitlab-runner-10.0.2.init,
+gitlab-runner-10.0.2.ebuild, +metadata.xml:
dev-vcs/gitlab-runner: Add ebuild for version 10.0.2; this is the first
ebuild of this package.

View File

@ -0,0 +1,8 @@
AUX gitlab-runner-10.0.2.conf 65 SHA256 7f43b103c893213b1601887c379e0630947225e8ce2d9d548e05ff031187c102 SHA512 c4ced5e015342e36f7e8308f78a3294317aa30437e59d7a824cc51b3ac1716e9d75184bc97559550dbbdb4e8f46570e62e3f8d940d6c63a3169a22341a53efdc WHIRLPOOL 95596232009123d0e3c3393261bfce9995478a77e4778572bcb6213f49d3fb709d5a2e43e00403b8faa219ffc7b7b5f1fc553479323b8340ad5b1d2fba717303
AUX gitlab-runner-10.0.2.init 666 SHA256 42360338ff935726f6756c442de0fd381e10fb7c0573df2a737e2b7972252c53 SHA512 161046d47b81dd484795beecd79cd3034dd9436ab8f194cf64f7bf96bfa77db6d362f7c3e67c1f05685de18e64374c34441e654c3bd17f4493279244c9987923 WHIRLPOOL 43d0de31551a982bf50781c9d43cb36a442aaf3407473334d204a911f9570d6582c8380ecee53ef3dbdeff193f83a4f47dc6739b3c85b901215053708c5ecfd4
DIST gitlab-runner-10.0.2-prebuilt-arm.tar.xz 8548448 SHA256 b73a0690eef09c4f366342f98bec301020d47c16f98ac8a770f373dd81a76b04 SHA512 78919f68bbb31fce1792427b9067491b5ef0a557a184039eedf89110d47e875bc67c0a67fdd3165374c264aa411392dcda31574953e5ffacc2a141eaa85d4626 WHIRLPOOL 59cfe9d085318c3169da969846c216d7eb1b1f1a5ae52808f2721722fc6da48f25c87a1e2f257b7e3d9a0fc8e9d02e43622add867dc3403b2134c45715228ad8
DIST gitlab-runner-10.0.2-prebuilt-x86_64.tar.xz 9562480 SHA256 58c95075273f44ff926823aa9b5bf9fd4cb82c87adc27bef48d5bf985d629992 SHA512 ea9339db46d8e683de42802ec52b499941e189b754bc43f600b673942fbf947941ac2ad7f1d63a938341df7982865595d5dc0557a08db4c78bc64067b2709539 WHIRLPOOL d6c9e66344f7334336031cafdec91dadd8941739584a41c71837fb247b3fb970826f23697758a8a3497e6667d300f1dff0ce8fe146389de0da9d15e2bbd1e78e
DIST gitlab-runner-10.0.2.tar.gz 3599514 SHA256 783c1c597a2b9ee78b2396852235010c5432804e8d65b65f49f4e3719f6da4c8 SHA512 9d8cac8441913c77c1b34dcf9f82ab1345d21f6a9553a7f895473289794c85c2675588b38c7cd390615c8e4cd14964c024562132b2b9dd88c9215ea165fc1c3d WHIRLPOOL e471f032040ffa3fbc0566df092425a19b3e9528907e87b49297512d665f187303baf24a918f855ee32fa0b1de3aac922a1ed13c8efcc22027e2fbd11fb2208d
EBUILD gitlab-runner-10.0.2.ebuild 2463 SHA256 98aeadd5e28ab738e4c3813f2ce525517994c6c4c9575a012dc5bbf4aa6ea9ae SHA512 1a3d6e4a824eb42ff51478178432a29181733b31212da470acdef60e899102ab12bdebad7a6ea4b70f009c723ebf2629a59c33af9ffe27a3ee91ac2e5444e182 WHIRLPOOL adc4b90b9e1d9b0fd2e70e6d157ae83035095a8a1d5275591e8c6b693de0da10d14d743286f1e40e67da58cbf17fe48354c9f59a4ccb7a4589ca48ef4e7c1af7
MISC ChangeLog 306 SHA256 808e2552439b928708bdd9db784c48fd5bf292fe453651d29401f362e7150e32 SHA512 652a440393cb63257b3b2b84134cb6d86bd64c2e3f8958e2d602d177c5a14813637d2965c3ffc92b1013c6cc3a46bce5ae8954a0f6f58e009c7c1d5e32ac7856 WHIRLPOOL 1eaa28cec659d3963e5bfb72537f810e6a5ba50b944adf6c2b524392afbb96725034b23ad2ce452f6120d01287aa1d432579a398d7291be4b97d9f22d6e764c4
MISC metadata.xml 329 SHA256 f0ae08a64aa32a07486e744ce11ac5448770b7320454015bcd065e312fcb5e9c SHA512 11e4eaf25633c5979e5243350bdf2ddc6d9dca06ab54ec38359591f1d002ea2a224e53b3e6c4ac53b5b2e795a87769fdbd97c547b008272e0a1491141f422e5d WHIRLPOOL ab2c1cb3d9aff1f757b49633f94d4b98da4b83dadab12ab8d869f9e1f6763b3125010147472e58e910e7fc42da262dbd69a1bf3939f3720a79ab4329184b4c35

View File

@ -0,0 +1,3 @@
LOGFILE=/var/log/gitlab-runner.log
USER=@USER@
HOME_DIR="@HOME@"

View File

@ -0,0 +1,23 @@
#!/sbin/openrc-run
# Copyright 2015-2017 Nicolas Heine
depend() {
after sshd
need net
need localmount
}
start() {
ebegin "Starting gitlab-runner"
checkpath -d /var/run
checkpath -f -o ${USER} -m640 "${LOGFILE}"
start-stop-daemon --start -b -u ${USER} --chdir "${HOME_DIR}" --pidfile /var/run/gitlab-runner.pid -1 "${LOGFILE}" -2 "${LOGFILE}" --make-pidfile \
--exec /usr/bin/gitlab-runner -- run --config /etc/gitlab-runner/config.toml
eend $?
}
stop() {
ebegin "Stopping gitlab-runner"
start-stop-daemon --stop --pidfile /var/run/gitlab-runner.pid
eend $?
}

View File

@ -0,0 +1,89 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
inherit golang-build golang-vcs-snapshot user
EGO_PN="gitlab.com/gitlab-org/gitlab-runner"
GITLAB_COMMIT="413da38a"
MY_PV="v${PV/_/-}"
DESCRIPTION="Official GitLab CI Runner written in Go"
HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-runner"
SRC_URI="https://gitlab.com/gitlab-org/${PN}/repository/archive.tar.gz?ref=v${PV} -> ${P}.tar.gz
!docker-build? (
https://${PN}-downloads.s3.amazonaws.com/${MY_PV}/docker/prebuilt-x86_64.tar.xz -> ${P}-prebuilt-x86_64.tar.xz
https://${PN}-downloads.s3.amazonaws.com/${MY_PV}/docker/prebuilt-arm.tar.xz -> ${P}-prebuilt-arm.tar.xz
)"
KEYWORDS="~amd64"
LICENSE="MIT"
SLOT="0"
IUSE="docker-build"
DEPEND="dev-go/gox
dev-go/go-bindata
docker-build? ( >=app-emulation/docker-1.5 )"
RESTRICT="mirror test"
MY_USER="gitlab_runner"
MY_HOME_DIR="/var/lib/gitlab-runner"
src_prepare() {
default
pushd src/${EGO_PN} || die
if ! use docker-build; then
mkdir -p out/docker || die
cp "${DISTDIR}"/${P}-prebuilt-x86_64.tar.xz out/docker/prebuilt-x86_64.tar.xz || die
cp "${DISTDIR}"/${P}-prebuilt-arm.tar.xz out/docker/prebuilt-arm.tar.xz || die
sed -i -e "s/docker info/echo false/" Makefile || die
else
einfo "You need to have docker running on your system during build time"
einfo "$(docker info)"
fi
sed -i -e "s#./ci/version#echo ${PV}#"\
-e "s/git rev-parse --short HEAD/echo ${GITLAB_COMMIT}/"\
-e "/^LATEST_STABLE_TAG/d"\
-e "s#git show-ref.*\$#echo gentoo)#"\
-e "s#git describe.*\$#echo 0), 0)#"\
Makefile || die
popd || die
}
src_compile() {
emake GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" RELEASE=true -C src/${EGO_PN} build_current
}
pkg_preinst() {
# add required user
enewgroup ${MY_USER}
enewuser ${MY_USER} -1 /bin/bash "${MY_HOME_DIR}" ${MY_USER}
}
src_install() {
dobin src/${EGO_PN}/out/binaries/gitlab-runner
dodoc src/${EGO_PN}/README.md src/${EGO_PN}/CHANGELOG.md
# rc script
newinitd "${FILESDIR}/${PN}-10.0.2.init" "${PN}"
# conf.d file
local conffile="${PN}-10.0.2.conf"
cp "${FILESDIR}/${conffile}" "${T}" || die
sed -i \
-e "s|@USER@|${MY_USER}|" \
-e "s|@HOME@|${MY_HOME_DIR}|" \
"${T}/${conffile}" \
|| die "failed to filter ${conffile}"
newconfd "${T}/${conffile}" "${PN}"
# config dir
local config_dir="/etc/${PN}"
diropts -m750
dodir "${config_dir}"
fowners -R ${MY_USER}:${MY_USER} "${config_dir}"
}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>manuel@fritteli.ch</email>
<name>Manuel Friedli</name>
</maintainer>
<use>
<flag name="docker-build">Use docker to build the images</flag>
</use>
</pkgmetadata>

View File

@ -0,0 +1,28 @@
Title: Rename gitlab-ci-multi-runner to gitlab-runner
Author: Manuel Friedli <manuel@fritteli.ch>
Content-Type: text/plain
Posted: 2017-11-05
Revision: 1
News-Item-Format: 1.0
Display-If-Installed: dev-vcs/gitlab-ci-multi-runner
Upstream renamed gitlab-ci-multi-runner to gitlab-runner. We want to
follow upstream as closely as possible. Therefore:
- A new ebuild dev-vcs/gitlab-runner is introduced for versions
>= 10.0.2.
- The old ebuilds (dev-vcs/gitlab-ci-multi-runner) remain, but will
probably not compile anymore, because the source files may have
moved. Runner ebuilds for versions < 10.0.2 will consequently be
removed from the overlay at some later point.
- The home directory is now at /var/lib/gitlab-runner instead of
/opt/gitlab-ci-multi-runner. Please note that no files are moved
from the old to the new location.
The new ebuilds will add a new user (gitlab_runner) to the system.
The old ebuilds used gitlab_ci_multi_runner as their user, which you
will have to remove by hand if you want to clean up.
There will be no automatic migration from the old to the new ebuild.
Have fun,
fritteli.