Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109285185
D42140.id128474.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D42140.id128474.diff
View Options
diff --git a/GIDs b/GIDs
--- a/GIDs
+++ b/GIDs
@@ -769,7 +769,7 @@
polw:*:825:
statsd:*:826:
_tuptime:*:827:
-# free: 828
+cirrus:*:828:
# free: 829
# free: 830
# free: 831
diff --git a/UIDs b/UIDs
--- a/UIDs
+++ b/UIDs
@@ -775,7 +775,7 @@
polw:*:825:825::0:0:Policyd-weight Cache Owner:/nonexistent:/sbin/nologin
statsd:*:826:826::0:0:Statsd Daemon:/nonexistent:/sbin/nologin
_tuptime:*:827:827::0:0:Tuptime:/var/lib/tuptime:/usr/sbin/nologin
-# free: 828
+cirrus:*:828:828::0:0:Cirrus CI:/usr/local/cirrus:/bin/sh
# free: 829
# free: 830
# free: 831
diff --git a/devel/cirrus-cli/Makefile b/devel/cirrus-cli/Makefile
--- a/devel/cirrus-cli/Makefile
+++ b/devel/cirrus-cli/Makefile
@@ -1,9 +1,10 @@
PORTNAME= cirrus-cli
PORTVERSION= 0.106.0
DISTVERSIONPREFIX= v
+PORTREVISION= 1
CATEGORIES= devel
-MASTER_SITES= https://raw.githubusercontent.com/${GH_ACCOUNT}/${GH_PROJECT}/${DISTVERSIONFULL}/:gomod
-DISTFILES= go.mod:gomod
+MASTER_SITES= https://raw.githubusercontent.com/${GH_ACCOUNT}/${GH_PROJECT}/${DISTVERSIONFULL}/:gomod
+DISTFILES= go.mod:gomod
MAINTAINER= bofh@FreeBSD.org
COMMENT= Command line interface for Cirrus CI
@@ -16,10 +17,18 @@
USE_GITHUB= yes
GH_ACCOUNT= cirruslabs
+USE_RC_SUBR= ${PORTNAME}
+
GO_MODULE= github.com/cirruslabs/cirrus-cli
GO_TARGET= ./cmd/cirrus
GO_BUILDFLAGS= -ldflags="-X github.com/cirruslabs/cirrus-cli/internal/version.Version=${PORTVERSION}"
-PLIST_FILES= bin/cirrus
+SUB_FILES= pkg-message
+
+USERS= cirrus
+GROUPS= cirrus
+
+post-install:
+ ${INSTALL_DATA} ${FILESDIR}/cirrus-worker.yml ${STAGEDIR}${PREFIX}/etc/cirrus-worker.yml.sample
.include <bsd.port.mk>
diff --git a/devel/cirrus-cli/files/cirrus-cli.in b/devel/cirrus-cli/files/cirrus-cli.in
new file mode 100644
--- /dev/null
+++ b/devel/cirrus-cli/files/cirrus-cli.in
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# PROVIDE: cirrus_cli
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Options to configure cirrus-cli via /etc/rc.conf:
+#
+# cirrus_cli_enable (bool) Enable service on boot
+# Default: NO
+#
+# cirrus_cli_conf (str) Config file to use
+# Default: %%ETCDIR%%/cirrus-worker.yml
+#
+# cirrus_cli_uid (str) User to run cirrus_cli as
+# Default: cirrus
+
+. /etc/rc.subr
+
+name="cirrus"
+rcvar="cirrus_cli_enable"
+pidfile="/var/run/cirrus-cli.pid"
+procname="%%PREFIX%%/bin/cirrus"
+
+load_rc_config $name
+
+: ${cirrus_cli_enable:="NO"}
+: ${cirrus_cli_conf:="%%PREFIX%%/etc/cirrus-worker.yml"}
+: ${cirrus_cli_uid:="cirrus"}
+
+command="/usr/sbin/daemon"
+command_args="-p ${pidfile} -u ${cirrus_cli_uid} ${procname} worker run -f ${cirrus_cli_conf}"
+
+run_rc_command "$1"
diff --git a/devel/cirrus-cli/files/cirrus-worker.yml b/devel/cirrus-cli/files/cirrus-worker.yml
new file mode 100644
--- /dev/null
+++ b/devel/cirrus-cli/files/cirrus-worker.yml
@@ -0,0 +1,12 @@
+token: CHANGEME
+
+name: cirrus1-on-premises-change-me
+
+labels:
+ jail: FreeBSD
+
+log:
+ level: info
+ file: /usr/local/cirrus/cirrus-worker.log
+ rotate-size: 100 MB
+ max-rotations: 10
diff --git a/devel/cirrus-cli/files/pkg-message.in b/devel/cirrus-cli/files/pkg-message.in
new file mode 100644
--- /dev/null
+++ b/devel/cirrus-cli/files/pkg-message.in
@@ -0,0 +1,11 @@
+[
+{ type: install
+ message: <<EOM
+A sample configuration file is installed at %%PREFIX%%/etc/cirrus-worker.yml,
+requiring a few modifications to work correctly.
+
+For more details about the configuration file, please refer to:
+https://github.com/cirruslabs/cirrus-cli/blob/master/PERSISTENT-WORKERS.md#configuration
+EOM
+}
+]
diff --git a/devel/cirrus-cli/pkg-plist b/devel/cirrus-cli/pkg-plist
new file mode 100644
--- /dev/null
+++ b/devel/cirrus-cli/pkg-plist
@@ -0,0 +1,8 @@
+bin/cirrus
+@owner root
+@group cirrus
+@mode 0640
+@sample etc/cirrus-worker.yml.sample
+@mode
+@group
+@owner
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 4, 1:36 AM (11 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16446072
Default Alt Text
D42140.id128474.diff (3 KB)
Attached To
Mode
D42140: devel/cirrus-cli: Add rc.d support
Attached
Detach File
Event Timeline
Log In to Comment