]> git.pld-linux.org Git - packages/gitlab-runner.git/commitdiff
init: add register command to easily register under proper user
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 31 Aug 2017 11:41:38 +0000 (14:41 +0300)
committerElan Ruusamäe <glen@pld-linux.org>
Thu, 31 Aug 2017 11:41:45 +0000 (14:41 +0300)
gitlab-ci-multi-runner.init

index 9b4d037f20f9d9c545d1e59771488de19bb67b24..e54cab868dede0a3c763f5df3ff1e793169b6eca 100755 (executable)
@@ -81,6 +81,11 @@ condrestart() {
        start
 }
 
+# run gitlab-runner register with proper uid/gid
+register() {
+       runuser -u "$USER" -g "$GROUP" gitlab-runner "$@"
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -100,12 +105,15 @@ case "$1" in
   force-reload)
        condrestart 7
        ;;
+  register)
+       register "$@"
+       ;;
   status)
        status --pidfile $PIDFILE $NAME
        RETVAL=$?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|register|status}"
        exit 3
 esac
 
This page took 0.136146 seconds and 4 git commands to generate.