diff --git a/doc/macos-ci-install/reconfig-gitlab-runner.sh b/doc/macos-ci-install/reconfig-gitlab-runner.sh new file mode 100755 index 0000000000000000000000000000000000000000..0bbf8b6a9b41b55b1c0828373e8e95449ab11a11 --- /dev/null +++ b/doc/macos-ci-install/reconfig-gitlab-runner.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -x + +if [[ $EUID == 0 ]]; then + # restarts to reconfigure as gitlab user + exec su gitlab -c "$(which bash) ${0}" +fi + +# the command above is bogus - it will use the "admin" user home dir +# you need to reconfigure it to fix this +cfgfile="/Users/gitlab/Library/LaunchAgents/homebrew.mxcl.gitlab-runner.plist" +/bin/launchctl stop $cfgfile +/bin/launchctl unload $cfgfile +/usr/bin/sed -i~ 's/admin/gitlab/g' $cfgfile +/bin/launchctl load $cfgfile +/bin/launchctl start $cfgfile diff --git a/doc/macos.rst b/doc/macos.rst index 3cafe4b4e588ae4d0a744c37a94df8f8b7c963bd..680f51825cf6b44b74ebf65ae567a7aa695faef1 100644 --- a/doc/macos.rst +++ b/doc/macos.rst @@ -151,16 +151,7 @@ Building the reference setup Configure the runner for `shell executor`_, with local caching. As ``gitlab`` user, execute on the command-line:: - $ brew services start gitlab-runner - # the command above is bogus - it will use the "admin" user home dir - # you need to reconfigure it to fix this - $ /bin/launchctl stop /Users/gitlab/Library/LaunchAgents/homebrew.mxcl.gitlab-runner.plist - $ /bin/launchctl unload /Users/gitlab/Library/LaunchAgents/homebrew.mxcl.gitlab-runner.plist - $ vim /Users/gitlab/Library/LaunchAgents/homebrew.mxcl.gitlab-runner.plist - # change all occurences of "admin" with "gitlab" - $ /bin/launchctl load /Users/gitlab/Library/LaunchAgents/homebrew.mxcl.gitlab-runner.plist - $ /bin/launchctl start /Users/gitlab/Library/LaunchAgents/homebrew.mxcl.gitlab-runner.plist - # n.b.: re-executing "brew services start gitlab-runner" will reset the file above + $ /bin/bash <(curl -s https://gitlab.idiap.ch/bob/bob.devtools/raw/master/doc/macos-ci-install/reconfig-gitlab-runner.sh) Once that is set, your runner configuration (``~/.gitlab-runner/config.toml``) should look like this (remove comments if gitlab does not like them)::