Created
January 20, 2017 21:31
-
-
Save zingmars/59f9c3abd925f24c14683e60f020cdf1 to your computer and use it in GitHub Desktop.
Revisions
-
zingmars created this gist
Jan 20, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ # 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 }