summaryrefslogtreecommitdiff
path: root/www/gitlab-pages
diff options
context:
space:
mode:
authorMatthias Fechner <mfechner@FreeBSD.org>2023-05-30 16:25:52 +0300
committerMatthias Fechner <mfechner@FreeBSD.org>2023-05-30 16:28:38 +0300
commit7cd195b1582f54938e4d9ca88cb3a09f0d9ff44b (patch)
treea0ce770338ca17400ca8aae0d21a8869bc62cfdf /www/gitlab-pages
parentdevel/gitlab-runner: update to 16.0.1 (diff)
www/gitlab-ce: simplify gitlab-pages documentation and add doce for it
How to configure Gitlab-Pages (currently without TLS) can be found here: https://gitlab.fechner.net/mfechner/Gitlab-docu/-/blob/master/install/16.0-freebsd.md#9-gitlab-pages I will check later if TLS configuration is even required if a TLS proxy like haproxy is in front of nginx.
Diffstat (limited to 'www/gitlab-pages')
-rw-r--r--www/gitlab-pages/Makefile21
-rw-r--r--www/gitlab-pages/files/gitlab_pages.in20
-rw-r--r--www/gitlab-pages/files/patch-gitlab-pages.conf.sample9
-rw-r--r--www/gitlab-pages/pkg-message3
4 files changed, 34 insertions, 19 deletions
diff --git a/www/gitlab-pages/Makefile b/www/gitlab-pages/Makefile
index 95d35175c675..917bd3e699be 100644
--- a/www/gitlab-pages/Makefile
+++ b/www/gitlab-pages/Makefile
@@ -1,5 +1,6 @@
PORTNAME= gitlab-pages
PORTVERSION= 16.0.1
+PORTREVISION= 1
DISTVERSIONPREFIX= v
CATEGORIES= www
MASTER_SITES+= https://gitlab.com/gitlab-org/gitlab-pages/-/raw/v${DISTVERSION}/
@@ -22,11 +23,27 @@ GL_COMMIT= 8cda253ced465c7c9764332d7f5210ea3c976236
GO_BUILDFLAGS= -ldflags="-X 'main.VERSION=${PORTVERSION}' -X 'main.REVISION=${GL_COMMIT}'"
-PLIST_FILES= bin/gitlab-pages
-
USE_RC_SUBR= gitlab_pages
USERS= gitlab-pages
GROUPS= gitlab-pages
+post-patch:
+ ${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|" ${WRKSRC}/gitlab-pages.conf.sample
+
+do-install:
+ @${MKDIR} ${STAGEDIR}${DATADIR}
+ ${MKDIR} ${STAGEDIR}${DATADIR}/bin
+ (cd ${WRKDIR}/bin/ && ${COPYTREE_BIN} . ${STAGEDIR}${DATADIR}/bin)
+.for x in gitlab-pages.conf.sample
+ ${INSTALL_DATA} ${WRKSRC}/${x} ${STAGEDIR}${DATADIR}/
+.endfor
+
+post-install:
+ ${FIND} -s ${STAGEDIR}${DATADIR} -not -type d | ${SORT} | \
+ ${SED} -e 's#^${STAGEDIR}${PREFIX}/##' | \
+ ${SED} -E -e '/sample$$/ s#^#@sample #; \
+ s#${DATADIR_REL}/bin#@(,,555) ${DATADIR_REL}/bin#; ' >> ${TMPPLIST}
+ cat ${TMPPLIST}
+
.include <bsd.port.mk>
diff --git a/www/gitlab-pages/files/gitlab_pages.in b/www/gitlab-pages/files/gitlab_pages.in
index 99a19a3bad2c..f49fd4b4e6f6 100644
--- a/www/gitlab-pages/files/gitlab_pages.in
+++ b/www/gitlab-pages/files/gitlab_pages.in
@@ -31,6 +31,7 @@ load_rc_config $name
: ${gitlab_pages_user:="gitlab-pages"}
: ${gitlab_pages_group:="gitlab-pages"}
: ${gitlab_pages_logfile:="/var/log/gitlab_pages.log"}
+: ${gitlab_pages_args:="-config=%%PREFIX%%/share/gitlab-pages/gitlab-pages.conf"}
export HOME=${gitlab_pages_dir}
export PATH=${PATH}:%%PREFIX%%/bin
@@ -38,24 +39,10 @@ export PATH=${PATH}:%%PREFIX%%/bin
pidfile="/var/run/${name}.pid"
gitlab_pages_chdir="${gitlab_pages_dir}"
-procname=%%PREFIX%%/bin/gitlab-pages
+procname=%%PREFIX%%/share/gitlab-pages/bin/gitlab-pages
start_precmd="gitlab_pages_startprecmd"
start_cmd="gitlab_pages_startcmd"
-list_cmd="listfunc"
-register_cmd="registerfunc"
-
-listfunc()
-{
- cd ${gitlab_pages_chdir} ; \
- su -m ${gitlab_pages_user} -c "env HOME=${gitlab_pages_dir} %%PREFIX%%/bin/gitlab-pages list"
-}
-
-registerfunc()
-{
- cd ${gitlab_pages_chdir} ; \
- su -m ${gitlab_pages_user} -c "env HOME=${gitlab_pages_dir} %%PREFIX%%/bin/gitlab-pages register"
-}
gitlab_pages_startprecmd()
{
@@ -70,8 +57,7 @@ gitlab_pages_startprecmd()
gitlab_pages_startcmd()
{
cd ${gitlab_pages_chdir} ; \
- daemon -u ${gitlab_pages_user} -p ${pidfile} /usr/local/bin/gitlab-pages ${gitlab_pages_args} run < /dev/null >> ${gitlab_pages_logfile} 2>> ${gitlab_pages_logfile}
+ daemon -u ${gitlab_pages_user} -p ${pidfile} ${procname} ${gitlab_pages_args} run < /dev/null >> ${gitlab_pages_logfile} 2>> ${gitlab_pages_logfile}
}
-extra_commands="list register"
run_rc_command $1
diff --git a/www/gitlab-pages/files/patch-gitlab-pages.conf.sample b/www/gitlab-pages/files/patch-gitlab-pages.conf.sample
new file mode 100644
index 000000000000..d73eae49370e
--- /dev/null
+++ b/www/gitlab-pages/files/patch-gitlab-pages.conf.sample
@@ -0,0 +1,9 @@
+--- gitlab-pages.conf.sample.orig 2023-05-30 05:09:18 UTC
++++ gitlab-pages.conf.sample
+@@ -0,0 +1,6 @@
++listen-http=:8090
++pages-root=%%PREFIX%%/www/gitlab-ce/shared/pages
++api-secret-key=%%PREFIX%%/www/gitlab-ce/.gitlab_pages_secret
++pages-domain=pages.example.com
++internal-gitlab-server=https://gitlab.example.com
++
diff --git a/www/gitlab-pages/pkg-message b/www/gitlab-pages/pkg-message
new file mode 100644
index 000000000000..433068142f99
--- /dev/null
+++ b/www/gitlab-pages/pkg-message
@@ -0,0 +1,3 @@
+for detailed installation/configuration instruction please see e.g. here:
+https://gitlab.fechner.net/mfechner/Gitlab-docu/-/blob/master/install/16.0-freebsd.md#9-gitlab-pages
+