CircleCI Runner Installation on macOS
This page describes how to install CircleCI runner on macOS.
|Please review the Installing the CircleCI Runner page to verify prerequisites and authentication.|
Create a CircleCI runner configuration
Choose a user to run the CircleCI agent. These instructions refer to the selected user as
Complete the template shown below, with the various capitalized parameters filled in. When complete, save the template as
api: auth_token: AUTH_TOKEN # On server, set url to the hostname of your server installation. For example, # url: https://circleci.example.com runner: name: RUNNER_NAME command_prefix : ["sudo", "-niHu", "USERNAME", "--"] working_directory: /tmp/%s cleanup_working_directory: true logging: file: /Library/Logs/com.circleci.runner.log
Install the CircleCI Runner configuration
Create a directory as
root to hold the CircleCI runner configuration:
sudo mkdir -p '/Library/Preferences/com.circleci.runner'
Copy the previously created
launch-agent-config.yaml into the directory:
sudo cp 'launch-agent-config.yaml' '/Library/Preferences/com.circleci.runner/launch-agent-config.yaml'
Copy the following to
/Library/LaunchDaemons/com.circleci.runner.plist, owned by
root, with permissions
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.circleci.runner</string> <key>Program</key> <string>/opt/circleci/circleci-launch-agent</string> <key>ProgramArguments</key> <array> <string>circleci-launch-agent</string> <string>--config</string> <string>/Library/Preferences/com.circleci.runner/launch-agent-config.yaml</string> </array> <key>RunAtLoad</key> <true/> <!-- The agent needs to run at all times --> <key>KeepAlive</key> <true/> <!-- This prevents macOS from limiting the resource usage of the agent --> <key>ProcessType</key> <string>Interactive</string> <!-- Increase the frequency of restarting the agent on failure, or post-update --> <key>ThrottleInterval</key> <integer>3</integer> <!-- Wait for 10 minutes for the agent to shut down (the agent itself waits for tasks to complete) --> <key>ExitTimeOut</key> <integer>600</integer> <!-- The agent uses its own logging and rotation to file --> <key>StandardOutPath</key> <string>/dev/null</string> <key>StandardErrorPath</key> <string>/dev/null</string> </dict> </plist>
If you are following these instructions for a second time, you should unload the following existing service:
sudo launchctl unload '/Library/LaunchDaemons/com.circleci.runner.plist'
Now you can load the service:
sudo launchctl load '/Library/LaunchDaemons/com.circleci.runner.plist'
Verify the service is running
The macOS application console can be used to view the logs for the CircleCI agent. Look under "Log Reports" for the logs called
Help make this document better
This guide, as well as the rest of our docs, are open-source and available on GitHub. We welcome your contributions.
- Suggest an edit to this page (please read the contributing guide first).
- To report a problem in the documentation, or to submit feedback and comments, please open an issue on GitHub.
- CircleCI is always seeking ways to improve your experience with our platform. If you would like to share feedback, please join our research community.
CircleCI Documentation by CircleCI is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.