My solution is to have the gitlab-runner user run the daemon. That way, I don't need the --user parameter. The same user pulls the CI server and executes the builds.
Here's my /Library/LaunchDaemons/com.gitlab.gitlab-runner.plist configuration file:
Indeed, for the iOS simulator to be able to spawn up the process has to be launched from the LaunchAgents of the build user instead of the LaunchDaemons.
I'd be happy to have look into this with a bit of guidance. @ayufan do you have any leads on whats required and what to start with?
Currently I'm using the following LaunchAgent file to launch the previous runner:
You guys just published a post [1] about using OS X for testing. You might want to reference this issue or update some of the info. I notice this bug says that installing as root is not supported in OS X but when you run as a user you get in bright yellow:
WARNING: Running in user-mode.WARNING: The user-mode requires you to manually start builds processing:WARNING: $ gitlab-runner runWARNING: Use sudo for system-mode:WARNING: $ sudo gitlab-runner...
Which would appear to imply that you should install it as root with sudo. At the very least if you can't fix this right away make SOME effort with having documentation be correct.
@cardoe This message is a little misleading, sorry for that. I did improve that. You should be able to install GitLab Runner as user service with gitlab-runner install running as normal user, not a privileged one.
Thanks @ayufan. The docs on launchctl appeared to imply user/UID should have worked but it did not until I was logged in through the GUI. I think this issue will be fixed with the v1.1 release based on the merge requests you've applied.
@cardoe The requirement for user to be logged in will stay. Otherwise you can't do UI interactions which are pretty common for builds on OSX. This is clearly documented in part describing OSX service.