Created
January 20, 2017 21:31
-
-
Save zingmars/59f9c3abd925f24c14683e60f020cdf1 to your computer and use it in GitHub Desktop.
gitlab-runner's Gentoo init.rc script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to add to startup simply run rc-update add gitlab-runner default | |
# this script assumes you installed the runner in /usr/bin. | |
#!/sbin/openrc-run | |
PIDFILE="/var/run/gitlab-ci-multi-runner.pid" | |
DAEMON="/usr/bin/gitlab-ci-multi-runner" | |
LOGFILE="/var/log/gitlab-ci-multi-runner.log" | |
USER="gitlab-runner" | |
GROUP="gitlab-runner" | |
extra_commands="update" | |
start() { | |
ebegin "Starting gitlab-runner" | |
start-stop-daemon --start --exec /usr/bin/gitlab-ci-multi-runner --pidfile "$PIDFILE" --chdir "/home/$USER" --background --make-pidfile --exec "$DAEMON" -- run &>> $LOGFILE | |
eend $? | |
} | |
stop() { | |
ebegin "Stopping gitlab-runner" | |
start-stop-daemon --stop --pidfile "$PIDFILE" --user "$USER" --exec "$DAEMON" --quiet | |
eend $? | |
} | |
update() { | |
stop | |
ebegin "Updating gitlab-runner" | |
wget -O /usr/bin/gitlab-ci-multi-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-linux-amd64 | |
start | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment