1

I've been looking at the instructions from jetbrains on how to install and setup build agents on mac. But it's only for one build agent, not multiple.

There's this .plist file looking like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Debug</key>
        <false/>
        <key>KeepAlive</key>
        <true/>
        <key>Label</key>
        <string>jetbrains.teamcity.BuildAgent</string>
        <key>OnDemand</key>
        <false/>
        <key>ProgramArguments</key>
        <array>
                <string>bash</string>
                <string>--login</string>
                <string>-c</string>
                <string>launcher/bin/TeamCityAgentService-macosx-universal-32 -c ../conf/wrapper.conf</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>StandardErrorPath</key>
        <string>logs/launchd.err.log</string>
        <key>StandardOutPath</key>
        <string>logs/launchd.out.log</string>
        <key>WorkingDirectory</key>
        <string>/opt/teamcity/buildAgent1</string>
</dict>
</plist>

According to the instructions I should run following command to start the agent:

sudo sh buildAgent1/bin/mac.launchd.sh load

Now, it seems to copy the file into here?

/opt/teamcity/buildAgent1/bin/jetbrains.teamcity.BuildAgent.plist

But how do I do when I want to add more? Should I put as many plist-files in /Library/LaunchAgents with different name or should I add more in the existing plist-file? And if so, what's the syntax for adding more things in there?

peuhse
  • 1,688
  • 2
  • 20
  • 32

2 Answers2

1
  1. Setup the agent into a different directory as the first one
  2. Choose a different name and ownPort in the buildAgent.properties
  3. Duplicate the ~/Library/LaunchAgents/jetbrains.teamcity.BuildAgent.plist into the same directory but choose a different name of the file
  4. Change the content of the <string> tag below <key>Label</key> to something unique. Update the path in the tag under the <key>WorkingDirectory</key> to point to the agent being configured.
  5. Reboot.
0

I think you should copy binaries to another directory, e.g. /opt/teamcity/buildAgent2/ and do exactly the same as for agent 1. In the file under [agent dir]/conf/buildAgent.properties there is a property ownPort=9090 so you should change it to let TC server to connect to both agents.

Krzysztof Wolny
  • 10,576
  • 4
  • 34
  • 46
  • The problem isn't starting multiple agents manually, it's how I make them all start automatically when starting the machine. There's only samples for one build agent speciefied in a plist-file. But how do I add the others? See the last section on my question post. – peuhse Jun 11 '15 at 12:52
  • I'm not a Mac user, but on Linux I do it via crontab - I set a job every 5 minutes to run the agent (s). If they are down - they will run, if they're running - no effect. If I have to guess I'd say you have to duplicate a file. – Krzysztof Wolny Jun 12 '15 at 19:47