Commit 55e54dc8 authored by swills's avatar swills
Browse files

devel/gitlab-runner: create port

GitLab Runner is the open source project that is used to run your jobs and send
the results back to GitLab. It is used in conjunction with GitLab CI, the
open-source continuous integration service included with GitLab that
coordinates the jobs.

WWW: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/tree/master
parent 01339e83
......@@ -728,6 +728,7 @@
SUBDIR += gitg0
SUBDIR += github-backup-utils
SUBDIR += gitinspector
SUBDIR += gitlab-runner
SUBDIR += gitlab-shell
SUBDIR += gitlist
SUBDIR += gitolite
......
# $FreeBSD$
PORTNAME= gitlab-runner
PORTVERSION= 1.11.1
CATEGORIES= devel
MASTER_SITES= \
https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/repository/archive.tar.bz2?ref=v${PORTVERSION}&dummy=/ \
https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/master/docker/:dockerx64 \
https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/master/docker/:dockerarm
DISTFILES= \
${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} \
prebuilt-x86_64.tar.xz:dockerx64 \
prebuilt-arm.tar.xz:dockerarm
DIST_SUBDIR= gitlab-runner
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= swills@FreeBSD.org
COMMENT= Official GitLab Runner written in Go
BUILD_DEPENDS= go:lang/go \
go-bindata:devel/go-bindata
RUN_DEPENDS= ca_root_nss>=0:security/ca_root_nss \
bash:shells/bash \
git:devel/git
USES= tar:bz2
GITHASH= a67a225cf0b1dc48820415e7fe9a4f176463a8ed
GITREV= 08a9e6f
GITBRANCH= 9-0-stable
WRKSRC= ${WRKDIR}/gitlab-ci-multi-runner-v${PORTVERSION}-${GITHASH}
PLIST_FILES= bin/gitlab-runner
USE_RC_SUBR= gitlab_runner
USERS= gitlab-runner
GROUPS= gitlab-runner
post-extract:
@${MKDIR} ${WRKSRC}/out/docker/
@${CP} ${DISTDIR}/${DIST_SUBDIR}/prebuilt-x86_64.tar.xz ${WRKSRC}/out/docker/
@${CP} ${DISTDIR}/${DIST_SUBDIR}/prebuilt-arm.tar.xz ${WRKSRC}/out/docker/
post-patch:
@${REINPLACE_CMD} \
-e "s!%%VERSION%%!${PORTVERSION}!g" \
-e "s!%%REVISION%%!${GITREV}!g" \
-e "s!%%BRANCH%%!${GITBRANCH}!g" \
${WRKSRC}/common/version.go
do-build:
@cd ${WRKSRC} && go-bindata \
-pkg docker \
-nocompress \
-nomemcopy \
-nometadata \
-prefix out/docker/ \
-o executors/docker/bindata.go \
out/docker/prebuilt-x86_64.tar.xz \
out/docker/prebuilt-arm.tar.xz
@cd ${WRKSRC} && go fmt executors/docker/bindata.go
@${MV} ${WRKSRC}/vendor ${WRKSRC}/src
@${MKDIR} ${WRKSRC}/src/gitlab.com/gitlab-org
@${LN} -s ${WRKSRC} ${WRKSRC}/src/gitlab.com/gitlab-org/gitlab-ci-multi-runner
@cd ${WRKSRC} && ${SETENV} GOPATH=${WRKSRC} go build -o gitlab-ci-multi-runner
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/gitlab-ci-multi-runner ${STAGEDIR}${PREFIX}/bin/gitlab-runner
.include <bsd.port.mk>
TIMESTAMP = 1491332218
SHA256 (gitlab-runner/gitlab-runner-1.11.1.tar.bz2) = a1730ab0e533079911a8c5cb79d66b382b53fb2377b6ebe62abe7df247fdca3c
SIZE (gitlab-runner/gitlab-runner-1.11.1.tar.bz2) = 2358955
SHA256 (gitlab-runner/prebuilt-x86_64.tar.xz) = bf93555ec260db68401155da73977bbb258af5e31cc8e958ba2984fd5c1ab0d1
SIZE (gitlab-runner/prebuilt-x86_64.tar.xz) = 8334468
SHA256 (gitlab-runner/prebuilt-arm.tar.xz) = 3f45bf8c89e2748ac667bf44065050b8e4c516fe0062d90581e5f9dd54305f1a
SIZE (gitlab-runner/prebuilt-arm.tar.xz) = 8793888
#!/bin/sh
# PROVIDE: gitlab_runner
# REQUIRE: DAEMON NETWORKING
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable gitlab_runner:
#
# gitlab_runner_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable gitlab-runner
# gitlab_runner_dir (str): Set to "/var/tmp/gitlab_runner" by default.
# Set it to directory to run gitlab-runner in
# gitlab_runner_user (str): Set to "gitlab-runner" by default.
# Set it to user to run gitlab_runner under
# gitlab_runner_group (str): Set to "gitlab-runner" by default.
# Set it to group to run gitlab-runner under
#
. /etc/rc.subr
name="gitlab_runner"
rcvar="gitlab_runner_enable"
load_rc_config $name
: ${gitlab_runner_enable:="NO"}
: ${gitlab_runner_dir:="/var/tmp/gitlab_runner"}
: ${gitlab_runner_user:="gitlab-runner"}
: ${gitlab_runner_group:="gitlab-runner"}
export HOME=${gitlab_runner_dir}
export PATH=${PATH}:%%PREFIX%%/bin
pidfile="/var/run/${name}.pid"
command="/usr/sbin/daemon"
command_args="-f -p ${pidfile} %%PREFIX%%/bin/gitlab-runner run"
gitlab_runner_chdir="${gitlab_runner_dir}"
procname=%%PREFIX%%/bin/gitlab-runner
start_precmd="gitlab_runner_startprecmd"
list_cmd="listfunc"
register_cmd="registerfunc"
listfunc()
{
su -m ${gitlab_runner_user} -c "env HOME=${gitlab_runner_dir} %%PREFIX%%/bin/gitlab-runner list"
}
registerfunc()
{
su -m ${gitlab_runner_user} -c "env HOME=${gitlab_runner_dir} %%PREFIX%%/bin/gitlab-runner register"
}
gitlab_runner_startprecmd()
{
if [ ! -e "${pidfile}" ]; then
install -g ${gitlab_runner_group} -o ${gitlab_runner_user} -- /dev/null "${pidfile}";
fi
if [ ! -d "${gitlab_runner_dir}" ]; then
install -d -o "${gitlab_runner_user}" -g "${gitlab_runner_group}" "${gitlab_runner_dir}"
fi
}
extra_commands="list register"
run_rc_command $1
--- common/version.go.orig 2017-03-22 15:25:34 UTC
+++ common/version.go
@@ -10,9 +10,9 @@ import (
)
var NAME = "gitlab-ci-multi-runner"
-var VERSION = "dev"
-var REVISION = "HEAD"
-var BRANCH = "HEAD"
+var VERSION = "%%VERSION%%"
+var REVISION = "%%REVISION%%"
+var BRANCH = "%%BRANCH%%"
var BUILT = "now"
var AppVersion AppVersionInfo
GitLab Runner is the open source project that is used to run your jobs and send
the results back to GitLab. It is used in conjunction with GitLab CI, the
open-source continuous integration service included with GitLab that
coordinates the jobs.
WWW: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/tree/master
==============================================================================
To enable gitlab-runner:
sysrc gitlab_runner_enable=yes
To start gitlab-runner:
service gitlab_runner start
To register with GitLab:
service gitlab_runner register
To list status of GitLab:
service gitlab_runner list
==============================================================================
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment