diff options
Diffstat (limited to 'dev-util/gitlab-runner')
| -rw-r--r-- | dev-util/gitlab-runner/Manifest | 3 | ||||
| -rw-r--r-- | dev-util/gitlab-runner/files/gitlab-runner.confd | 4 | ||||
| -rw-r--r-- | dev-util/gitlab-runner/files/gitlab-runner.initd | 15 | ||||
| -rw-r--r-- | dev-util/gitlab-runner/files/gitlab-runner.service | 17 | ||||
| -rw-r--r-- | dev-util/gitlab-runner/files/gitlab-runner.tmpfile | 1 | ||||
| -rw-r--r-- | dev-util/gitlab-runner/gitlab-runner-13.0.1.ebuild | 79 | ||||
| -rw-r--r-- | dev-util/gitlab-runner/gitlab-runner-13.1.0.ebuild | 79 | ||||
| -rw-r--r-- | dev-util/gitlab-runner/metadata.xml | 22 |
8 files changed, 220 insertions, 0 deletions
diff --git a/dev-util/gitlab-runner/Manifest b/dev-util/gitlab-runner/Manifest new file mode 100644 index 000000000000..40ba6f36dae0 --- /dev/null +++ b/dev-util/gitlab-runner/Manifest @@ -0,0 +1,3 @@ +DIST gitlab-runner-13.0.1.tar.bz2 5143395 BLAKE2B a3511ff8e8fec6a7d4c6079b88152b01ead72cd06800adb8b415318937f1f55301937b9a121ba61ee2ded62533a5a544d730dcde141a331c0c09edc093a5c8d7 SHA512 2bd65168874a9ca53d6959232a20b815c9db5844c29f63c572a9cdd5b1ffd2b6034cdebed29c12ce0c7b16b06c0db93d48f6459f06a2089a11c261bddacd2365 +DIST gitlab-runner-13.1.0.tar.bz2 5125756 BLAKE2B 3d06baff5ad6bc2930a5a0b4c98befe2315a9d9e33e864301cda4e99516479de6dc87927968cb2b1c9d32cf708c5dd58a4d240c706299cdab8df90dc81db35aa SHA512 79e491dad6ae71c1aa4bccd7712e8d6a45ee1c31b9eb2fe47bee0cfb7ee2bb4fc664a5476654551ff25f698836f6d2f9c76ac853c15cf6f48e5c5dddd11f629a +DIST prebuilt-x86_64.tar.xz 11854360 BLAKE2B 98cfd7e706880acf9d1fc91f6fe5ff77d26d30c1dc126f5f11870c2d8a46ca6862545ad57acc0883cf6312e85c988a80dc82bff587b8d3901d6f848addd7ab7e SHA512 692e0ae4c7ced8c8a55970f3426824e14b3e251df85342c615db8d86eb9e22e0e7378d6c4958296f87721f86058216ac2ab9e32e8e0cccfd03579cd8f215b82d diff --git a/dev-util/gitlab-runner/files/gitlab-runner.confd b/dev-util/gitlab-runner/files/gitlab-runner.confd new file mode 100644 index 000000000000..d6fa9e1b1b73 --- /dev/null +++ b/dev-util/gitlab-runner/files/gitlab-runner.confd @@ -0,0 +1,4 @@ +# Config file for /etc/init.d/gitlab-runner + +# extra options (run gitlab-runner -h for a list of supported options) +RUNNER_OPTS="--config /etc/gitlab-runner/config.toml --working-directory /var/lib/gitlab-runner --service gitlab-runner" diff --git a/dev-util/gitlab-runner/files/gitlab-runner.initd b/dev-util/gitlab-runner/files/gitlab-runner.initd new file mode 100644 index 000000000000..70f6a02edfd1 --- /dev/null +++ b/dev-util/gitlab-runner/files/gitlab-runner.initd @@ -0,0 +1,15 @@ +#!/sbin/openrc-run +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +command="/usr/bin/gitlab-runner" +command_args="run ${RUNNER_OPTS}" +command_background="yes" +command_user="${USER:-runner}:${GROUP:-gitlab}" +description="GitLab Runner" +name="Gitlab Runner" +pidfile="/run/gitlab-runner/${RC_SVCNAME}.pid" + +depend() { + need net +} diff --git a/dev-util/gitlab-runner/files/gitlab-runner.service b/dev-util/gitlab-runner/files/gitlab-runner.service new file mode 100644 index 000000000000..8a6879a47f71 --- /dev/null +++ b/dev-util/gitlab-runner/files/gitlab-runner.service @@ -0,0 +1,17 @@ +[Unit] +Description=GitLab Runner +After=syslog.target network.target +ConditionFileIsExecutable=/usr/bin/gitlab-runner + +[Service] +StartLimitInterval=5 +StartLimitBurst=10 +ExecStart=/usr/bin/gitlab-runner "run" "--working-directory" "/var/lib/gitlab-runner" "--config" "/etc/gitlab-runner/config.toml" "--service" "gitlab-runner" "--user" "runner" +Restart=always +RestartSec=120 +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=gitlab-runner + +[Install] +WantedBy=multi-user.target diff --git a/dev-util/gitlab-runner/files/gitlab-runner.tmpfile b/dev-util/gitlab-runner/files/gitlab-runner.tmpfile new file mode 100644 index 000000000000..342d71594ea8 --- /dev/null +++ b/dev-util/gitlab-runner/files/gitlab-runner.tmpfile @@ -0,0 +1 @@ +d /run/gitlab-runner 0755 runner gitlab diff --git a/dev-util/gitlab-runner/gitlab-runner-13.0.1.ebuild b/dev-util/gitlab-runner/gitlab-runner-13.0.1.ebuild new file mode 100644 index 000000000000..d8391a781ac7 --- /dev/null +++ b/dev-util/gitlab-runner/gitlab-runner-13.0.1.ebuild @@ -0,0 +1,79 @@ +# Copyright 2020 Liguros Authors +# Distributed under the terms of the GNU General Public License v2 +EAPI=7 + +EGO_PN="gitlab.com/gitlab-org/gitlab-runner" +BASE_URI="https://gitlab-runner-downloads.s3.amazonaws.com/v${PV}/helper-images/prebuilt-_arch_.tar.xz" + +inherit golang-build golang-vcs-snapshot user readme.gentoo-r1 systemd tmpfiles user + +DESCRIPTION="GitLab Runner" +HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-runner" +SRC_URI="https://${EGO_PN}/repository/v${PV}/archive.tar.bz2 -> ${P}.tar.bz2 + docker? ( amd64? ( ${BASE_URI/_arch_/x86_64} ) )" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="docker" + +RDEPEND="docker? ( >=app-emulation/docker-1.13.0 )" +DEPEND="${RDEPEND}" + +RESTRICT="mirror strip" + +DOCS=( "${S}"/src/"${EGO_PN}"/{CHANGELOG,README}.md ) + +DOC_CONTENTS="Register the runner as root using\\n +\\t# gitlab-runner register\\n +Configure the runner in /etc/gitlab-runner/config.toml" + +pkg_setup() { + enewgroup gitlab + enewuser runner -1 /bin/bash /var/lib/gitlab-runner gitlab +} + +src_unpack() { + golang-vcs-snapshot_src_unpack + + if use docker ; then + mkdir -p "${S}"/out/helper-images || die "mkdir failed" + if use amd64 ; then + ln -sf "${DISTDIR}"/prebuilt-x86_64.tar.xz \ + "${S}"/out/helper-images/prebuilt-x86_64.tar.xz \ + || die "ln failed" + fi + fi +} + +src_install() { + einstalldocs + + exeinto /usr/libexec/gitlab-runner + doexe gitlab-runner + dosym ../libexec/gitlab-runner/gitlab-runner /usr/bin/gitlab-runner + + if use docker ; then + insinto /usr/libexec/gitlab-runner/helper-images + doins -r out/helper-images/*.tar.xz + fi + + newconfd "${FILESDIR}"/gitlab-runner.confd gitlab-runner + newinitd "${FILESDIR}"/gitlab-runner.initd gitlab-runner + systemd_dounit "${FILESDIR}"/gitlab-runner.service + newtmpfiles "${FILESDIR}"/gitlab-runner.tmpfile gitlab-runner.conf + + readme.gentoo_create_doc + + insopts -orunner -ggitlab -m0600 + insinto /etc/gitlab-runner + doins "${S}"/src/"${EGO_PN}"/config.toml.example + + diropts -orunner -ggitlab -m0700 + keepdir /etc/gitlab-runner /var/lib/gitlab-runner +} + +pkg_postinst() { + tmpfiles_process gitlab-runner.conf + readme.gentoo_print_elog +} diff --git a/dev-util/gitlab-runner/gitlab-runner-13.1.0.ebuild b/dev-util/gitlab-runner/gitlab-runner-13.1.0.ebuild new file mode 100644 index 000000000000..d8391a781ac7 --- /dev/null +++ b/dev-util/gitlab-runner/gitlab-runner-13.1.0.ebuild @@ -0,0 +1,79 @@ +# Copyright 2020 Liguros Authors +# Distributed under the terms of the GNU General Public License v2 +EAPI=7 + +EGO_PN="gitlab.com/gitlab-org/gitlab-runner" +BASE_URI="https://gitlab-runner-downloads.s3.amazonaws.com/v${PV}/helper-images/prebuilt-_arch_.tar.xz" + +inherit golang-build golang-vcs-snapshot user readme.gentoo-r1 systemd tmpfiles user + +DESCRIPTION="GitLab Runner" +HOMEPAGE="https://gitlab.com/gitlab-org/gitlab-runner" +SRC_URI="https://${EGO_PN}/repository/v${PV}/archive.tar.bz2 -> ${P}.tar.bz2 + docker? ( amd64? ( ${BASE_URI/_arch_/x86_64} ) )" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="docker" + +RDEPEND="docker? ( >=app-emulation/docker-1.13.0 )" +DEPEND="${RDEPEND}" + +RESTRICT="mirror strip" + +DOCS=( "${S}"/src/"${EGO_PN}"/{CHANGELOG,README}.md ) + +DOC_CONTENTS="Register the runner as root using\\n +\\t# gitlab-runner register\\n +Configure the runner in /etc/gitlab-runner/config.toml" + +pkg_setup() { + enewgroup gitlab + enewuser runner -1 /bin/bash /var/lib/gitlab-runner gitlab +} + +src_unpack() { + golang-vcs-snapshot_src_unpack + + if use docker ; then + mkdir -p "${S}"/out/helper-images || die "mkdir failed" + if use amd64 ; then + ln -sf "${DISTDIR}"/prebuilt-x86_64.tar.xz \ + "${S}"/out/helper-images/prebuilt-x86_64.tar.xz \ + || die "ln failed" + fi + fi +} + +src_install() { + einstalldocs + + exeinto /usr/libexec/gitlab-runner + doexe gitlab-runner + dosym ../libexec/gitlab-runner/gitlab-runner /usr/bin/gitlab-runner + + if use docker ; then + insinto /usr/libexec/gitlab-runner/helper-images + doins -r out/helper-images/*.tar.xz + fi + + newconfd "${FILESDIR}"/gitlab-runner.confd gitlab-runner + newinitd "${FILESDIR}"/gitlab-runner.initd gitlab-runner + systemd_dounit "${FILESDIR}"/gitlab-runner.service + newtmpfiles "${FILESDIR}"/gitlab-runner.tmpfile gitlab-runner.conf + + readme.gentoo_create_doc + + insopts -orunner -ggitlab -m0600 + insinto /etc/gitlab-runner + doins "${S}"/src/"${EGO_PN}"/config.toml.example + + diropts -orunner -ggitlab -m0700 + keepdir /etc/gitlab-runner /var/lib/gitlab-runner +} + +pkg_postinst() { + tmpfiles_process gitlab-runner.conf + readme.gentoo_print_elog +} diff --git a/dev-util/gitlab-runner/metadata.xml b/dev-util/gitlab-runner/metadata.xml new file mode 100644 index 000000000000..291b5fff5924 --- /dev/null +++ b/dev-util/gitlab-runner/metadata.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>spiderx@spiderx.dp.ua</email> + <name>Vladimir Pavljuchenkov</name> + </maintainer> + <maintainer type="project"> + <email>dev@liguros.net</email> + <name>Development</name> + </maintainer> + <longdescription lang="en"> + A Gitlab CI runner that executes jobs and send the results back to GitLab + </longdescription> + <use> + <flag name="docker">Add support for docker executors</flag> + </use> + <upstream> + <remote-id type="gitlab">gitlab-org/gitlab-runner</remote-id> + </upstream> + <origin>ports</origin> +</pkgmetadata> |
