ports/devel/buildkite-agent/files/buildkite.in
Dave Cottlehuber 4fe8371090 devel/buildkite-agent: NEW PORT
The Buildkite agent is a small, reliable and cross-platform build runner
that makes it easy to run automated builds on your own infrastructure,
using the proprietary BuildKite application and infrastructure.

Its main responsibilities are polling buildkite.com for work, running
build jobs, reporting back the status code and output log of the job,
and uploading the job's artifacts.

Sponsored by:	SkunkWerks, GmbH
Differential Revision: https://reviews.freebsd.org/D35043
2022-05-17 14:07:50 +00:00

49 lines
1.4 KiB
Bash

#!/bin/sh
# PROVIDE: buildkite
# REQUIRE: LOGIN NETWORKING SERVERS
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# buildkite_enable (bool): Set to NO by default.
# Set it to YES to enable buildkite.
#
# buildkite_config (string): Optional full path for buildkite config file
# buildkite_token (args): Optional buildkite token
# buildkite_account (user): Set to nobody by default.
# buildkite_vars (env): Pass in environment variables, "" by default
# buildkite_options (string): Pass in additional flags to agent
# buildkite_flags (string): Pass in additional flags to daemon(8)
. /etc/rc.subr
name=buildkite
rcvar=buildkite_enable
load_rc_config $name
: ${buildkite_enable:=NO}
: ${buildkite_logfile:=/var/log/buildkite.log}
: ${buildkite_account:=nobody}
: ${buildkite_config:="%%ETCDIR%%/buildkite-agent.cfg"}
: ${buildkite_flags:=""}
: ${buildkite_options:=""}
: ${buildkite_vars:=""}
pidfile=/var/run/buildkite.pid
command=/usr/sbin/daemon
command_args="-t ${name} \
-u ${buildkite_account} \
-r -P ${pidfile} \
/usr/bin/env ${buildkite_vars} \
HOME=`pw usershow ${buildkite_account} | cut -d: -f9` \
BUILDKITE_AGENT_TOKEN=${buildkite_token} \
%%PREFIX%%/bin/buildkite-agent start \
--config ${buildkite_config} \
${buildkite_options}"
required_files="${buildkite_config}"
run_rc_command "$1"