Terminal

Bash scripts, command line tips, etc.

Registering a Gitlab runners with Parallels

Below are some helpful commands for registering a Gitlab runner. Be aware that after registering it can take a few minutes before the runner is active and available.

# First you can check the details of currently set up runners (will give u the config file path too)
gitlab-runner list

# You can register a runner like so (with SSH info...more if you register --help)
gitlab-runner register -r TOKEN -u "https://gitlab.com/" --ssh-user SSHUSER --ssh-password SSHPW

# You can unregister with the token from the config file
gitlab-runner unregister -t TOKEN -u "https://gitlab.com/"

# You should usually restart after changing...
gitlab-runner restart

Enabling Parallels VM

On macOS gitlab-runner will not be aware of prlctl because it is located in /usr/local/bin which is not part of the default PATH. The only thing that really worked for me is this solution of adding the PATH to Library/LaunchAgents/gitlab-runner.plist:

<key>EnvironmentVariables</key>
<dict>
    <key>PATH</key>
    <string>/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>

Then restart gitlab-runner and you are good to go.

Also you should:

  • Install gitlab-runner executable inside the VM
  • Install homebrewfastlane and other tools you need.
  • Run fastlane build a few times on a project and allow all unidentified developers (via Sys Preferences / Security)
  • Don't forget to add your private key to the keychain so Fastlane match can do its magic
  • You might have to add a certificate and mark your private key as "Allow all to use" using Keychain Access