github.com/discordapp/buildkite-agent@v2.6.6+incompatible/templates/0.2/launchd.plist (about)

     1  <?xml version="1.0" encoding="UTF-8"?>
     2  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
     3  <!--
     4    This is an example launchd config for loading buildbox-agent on system boot on OS X systems using launchd
     5  
     6    To install:
     7  
     8      # Download the launchd config to /Library/LaunchAgents/ (it needs to be owned by root:wheel)
     9      sudo curl -o /Library/LaunchAgents/io.buildbox.buildbox-agent.plist https://raw.githubusercontent.com/buildbox/buildbox-agent/master/templates/launchd.plist
    10  
    11      # Set the user to run buildbox-agent as (usually `whoami`). It should be a full OS X user created via System Prefs, and the one you installed buildbox-agent under.
    12      sudo sed -i '' "s/your-build-user/[insert username here]/g" /Library/LaunchAgents/io.buildbox.buildbox-agent.plist
    13  
    14      # Set the agent's name
    15      sudo sed -i '' "s/your-agent-name/[insert agent name]/g" /Library/LaunchAgents/io.buildbox.buildbox-agent.plist
    16  
    17      # Set the agent's access token
    18      sudo sed -i '' "s/your-agent-access-token/[insert agent access token here]/g" /Library/LaunchAgents/io.buildbox.buildbox-agent.plist
    19  
    20      # Create the agent's log directory with permissions for your user
    21      sudo mkdir -p /usr/local/var/log
    22      sudo chmod 775 /usr/local/var/log
    23      sudo chown root:staff /usr/local/var/log
    24  
    25      # Add it to launchd (which also starts buildbox-agent)
    26      launchctl load /Library/LaunchAgents/io.buildbox.buildbox-agent.plist
    27  
    28      # Check the logs
    29      tail -f /usr/local/var/log/buildbox-agent.log
    30  
    31      # Troubleshooting
    32      If you're setting up a new user for your buildbox-agent, the agent may stall on the first attempt of cloning code from your code host.
    33  
    34      To solve this you need trust the the RSA fingerprint of your code host manually, just run the following.
    35  
    36      ssh github.com
    37  
    38    If you need to edit the plist:
    39  
    40      # Edit the plist, and then...
    41      launchctl unload /Library/LaunchAgents/io.buildbox.buildbox-agent.plist
    42      launchctl load /Library/LaunchAgents/io.buildbox.buildbox-agent.plist
    43  -->
    44  <plist version="1.0">
    45    <dict>
    46      <key>Label</key>
    47      <string>io.buildbox.buildbox-agent</string>
    48  
    49      <key>UserName</key>
    50      <string>your-build-user</string>
    51  
    52      <key>ProgramArguments</key>
    53      <array>
    54        <string>/Users/your-build-user/.buildbox/buildbox-agent</string>
    55        <string>start</string>
    56      </array>
    57  
    58      <key>KeepAlive</key>
    59      <true/>
    60  
    61      <key>RunAtLoad</key>
    62      <true/>
    63  
    64      <key>OnDemand</key>
    65      <false/>
    66  
    67      <key>ProcessType</key>
    68      <string>Interactive</string>
    69  
    70      <key>SessionCreate</key>
    71      <true/>
    72  
    73      <key>ThrottleInterval</key>
    74      <integer>30</integer>
    75  
    76      <key>StandardOutPath</key>
    77      <string>/usr/local/var/log/buildbox-agent.log</string>
    78  
    79      <key>StandardErrorPath</key>
    80      <string>/usr/local/var/log/buildbox-agent.log</string>
    81  
    82      <key>EnvironmentVariables</key>
    83      <dict>
    84        <key>PATH</key>
    85        <string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin</string>
    86  
    87        <key>BUILDBOX_AGENT_ACCESS_TOKEN</key>
    88        <string>your-agent-access-token</string>
    89      </dict>
    90    </dict>
    91  </plist>