diff options
Diffstat (limited to 'devel/forgejo-runner')
-rw-r--r-- | devel/forgejo-runner/Makefile | 40 | ||||
-rw-r--r-- | devel/forgejo-runner/distinfo | 7 | ||||
-rw-r--r-- | devel/forgejo-runner/files/act_runner.in | 52 | ||||
-rw-r--r-- | devel/forgejo-runner/files/patch-internal_pkg_config_config.example.yaml | 11 | ||||
-rw-r--r-- | devel/forgejo-runner/pkg-descr | 4 | ||||
-rw-r--r-- | devel/forgejo-runner/pkg-message | 9 | ||||
-rw-r--r-- | devel/forgejo-runner/pkg-plist | 3 |
7 files changed, 126 insertions, 0 deletions
diff --git a/devel/forgejo-runner/Makefile b/devel/forgejo-runner/Makefile new file mode 100644 index 000000000000..8bac829c5a07 --- /dev/null +++ b/devel/forgejo-runner/Makefile @@ -0,0 +1,40 @@ +PORTNAME= act_runner +DISTVERSIONPREFIX= v +DISTVERSION= 9.1.0 +CATEGORIES= devel +PKGNAMEPREFIX= forgejo- + +PATCH_SITES= https://code.forgejo.org/forgejo/runner/commit/ +PATCHFILES= 34731a41be456d5b6328d8c118ba8e0b6c6a226b.diff:-p1 + +MAINTAINER= daniel@morante.net +COMMENT= Act runner is a runner for Forgejo based on the Gitea Act runner +WWW= https://code.forgejo.org/forgejo/runner + +LICENSE= MIT APACHE20 +LICENSE_COMB= multi +LICENSE_FILE_APACHE20= ${WRKSRC}/act/container/DOCKER_LICENSE +LICENSE_FILE_MIT= ${WRKSRC}/LICENSE + +USES= go:modules +USE_RC_SUBR= ${PORTNAME} + +GO_MODULE= code.forgejo.org/forgejo/runner/v9 +GO_BUILDFLAGS= -ldflags "${LD_FLAG_STRING}" + +LD_FLAG_STRING= -s ${LD_FLAG_X_PREFIX}.version=${DISTVERSION} +LD_FLAG_X_PREFIX= -X ${GO_MODULE}/internal/pkg/ver + +DATADIR= /var/db/${PORTNAME} + +USERS= ${ACT_RUNNER_USER} +GROUPS= ${ACT_RUNNER_GROUP} + +ACT_RUNNER_USER?= ${PORTNAME} +ACT_RUNNER_GROUP?= ${PORTNAME} + +post-install: + ${MKDIR} ${STAGEDIR}${DATADIR} ${STAGEDIR}${ETCDIR} + ${INSTALL_DATA} ${BUILD_WRKSRC}/internal/pkg/config/config.example.yaml ${STAGEDIR}${ETCDIR}/act_runner.conf.sample + +.include <bsd.port.mk> diff --git a/devel/forgejo-runner/distinfo b/devel/forgejo-runner/distinfo new file mode 100644 index 000000000000..d14519ac11f9 --- /dev/null +++ b/devel/forgejo-runner/distinfo @@ -0,0 +1,7 @@ +TIMESTAMP = 1755498518 +SHA256 (go/devel_forgejo-runner/act_runner-v9.1.0/v9.1.0.mod) = 18d6c2c0fe0ff15434a5a60eb0a26d3c17ad1103d9e93f4c1272d551fcb756a7 +SIZE (go/devel_forgejo-runner/act_runner-v9.1.0/v9.1.0.mod) = 4728 +SHA256 (go/devel_forgejo-runner/act_runner-v9.1.0/v9.1.0.zip) = c7b6012a46048aeddb49e0429a20fdc72905974667516fcf0884af8007c4ac02 +SIZE (go/devel_forgejo-runner/act_runner-v9.1.0/v9.1.0.zip) = 3878583 +SHA256 (go/devel_forgejo-runner/act_runner-v9.1.0/34731a41be456d5b6328d8c118ba8e0b6c6a226b.diff) = fe7da83cfa0170b819ced458bafec9dd4b8353b275256409e269153d65b3fe8a +SIZE (go/devel_forgejo-runner/act_runner-v9.1.0/34731a41be456d5b6328d8c118ba8e0b6c6a226b.diff) = 3891 diff --git a/devel/forgejo-runner/files/act_runner.in b/devel/forgejo-runner/files/act_runner.in new file mode 100644 index 000000000000..fa243278cc7e --- /dev/null +++ b/devel/forgejo-runner/files/act_runner.in @@ -0,0 +1,52 @@ +#!/bin/sh + +# PROVIDE: act_runner +# REQUIRE: NETWORKING SYSLOG +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable act_runner: +# +# act_runner_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable act_runner. + +. /etc/rc.subr + +name="act_runner" +rcvar="act_runner_enable" + +load_rc_config "${name}" + +: ${act_runner_user:="act_runner"} +: ${act_runner_enable:="NO"} +: ${act_runner_facility:="daemon"} +: ${act_runner_priority:="debug"} +: ${act_runner_config:="%%ETCDIR%%/act_runner.conf"} +: ${act_runner_cache_dir:="%%DATADIR%%"} +: ${act_runner_log_dir:="/var/log/act_runner"} +: ${act_runner_log_file:="${act_runner_log_dir}/act_runner.log"} +: ${act_runner_flags:="-c ${act_runner_config} daemon"} + +procname="%%PREFIX%%/bin/act_runner" +command="${procname} ${act_runner_flags}" + +pidfile="/var/run/${name}.pid" + +start_cmd="${name}_start" +sig_stop=KILL + +act_runner_start() { + # ensure the log directories are owned by the unprivileged user + for d in "${act_runner_log_dir}"; do + if [ ! -e "$d" ]; then + mkdir "$d" + chown "${act_runner_user}" "$d" + fi + done + /usr/sbin/daemon -S -l "${act_runner_facility}" -s "${act_runner_priority}" \ + -T "${name}" \ + -u "${act_runner_user}" -p "${pidfile}" \ + -o "${act_runner_log_file}" \ + $command +} + +run_rc_command "$1" diff --git a/devel/forgejo-runner/files/patch-internal_pkg_config_config.example.yaml b/devel/forgejo-runner/files/patch-internal_pkg_config_config.example.yaml new file mode 100644 index 000000000000..8eb55b994c24 --- /dev/null +++ b/devel/forgejo-runner/files/patch-internal_pkg_config_config.example.yaml @@ -0,0 +1,11 @@ +--- internal/pkg/config/config.example.yaml.orig 2025-08-18 06:29:45 UTC ++++ internal/pkg/config/config.example.yaml +@@ -11,7 +11,7 @@ runner: + + runner: + # Where to store the registration result. +- file: .runner ++ file: /var/db/act_runner/.runner + # Execute how many tasks concurrently at the same time. + capacity: 1 + # Extra environment variables to run jobs. diff --git a/devel/forgejo-runner/pkg-descr b/devel/forgejo-runner/pkg-descr new file mode 100644 index 000000000000..9e455f279afb --- /dev/null +++ b/devel/forgejo-runner/pkg-descr @@ -0,0 +1,4 @@ +Act runner is a runner for Forgejo based on the Gitea Act runner + +This is a fork of the Gitea act runner developed and maintained by Forgejo +community and intended to be used with Forgejo only. diff --git a/devel/forgejo-runner/pkg-message b/devel/forgejo-runner/pkg-message new file mode 100644 index 000000000000..d1da2367b237 --- /dev/null +++ b/devel/forgejo-runner/pkg-message @@ -0,0 +1,9 @@ +[ +{ type: install + message: <<EOM +FreeBSD does not support Docker. +When configuring the runner, use 'host' as the label. e.g. +act_runner register --labels FreeBSD:host,FreeBSD-14.3:host +EOM +} +] diff --git a/devel/forgejo-runner/pkg-plist b/devel/forgejo-runner/pkg-plist new file mode 100644 index 000000000000..a56480528e5e --- /dev/null +++ b/devel/forgejo-runner/pkg-plist @@ -0,0 +1,3 @@ +bin/act_runner +@sample %%ETCDIR%%/act_runner.conf.sample +@dir(%%ACT_RUNNER_USER%%,%%ACT_RUNNER_GROUP%%,750) %%DATADIR%% |