Skip to content

Instantly share code, notes, and snippets.

@ianbattersby
Created January 26, 2013 09:46
Show Gist options
  • Save ianbattersby/4641450 to your computer and use it in GitHub Desktop.
Save ianbattersby/4641450 to your computer and use it in GitHub Desktop.
Ubuntu TeamCity agent setup
#!/bin/bash
# THESE ARE NOTES, NOT TESTED AS SCRIPT!
# We need the following to get and run teamcity agent
sudo apt-get install openjdk-7-jre-headless
sudo apt-get install unzip #For unzipping buildAgent.zip
# For compiling Simple.Web
sudo apt-get install ruby1.9.1
# We need the following for compiling mono
sudo apt-get install build-essential #For compiling source
sudo apt-get install autoconf #Should get automake
sudo apt-get install libtool
sudo apt-get install gettext
sudo apt-get install mono-complete #Believe it or not, we need Mono to build Mono
# Get build agent from TC server and unpack in /var/TeamCity
(cd ~/; wget http://teamcity.cloudapp.net/update/buildAgent.zip)
(cd /var; sudo mkdir TeamCity; cd TeamCity)
sudo unzip ~/buildAgent.zip
(cd bin; sudo chmod +x agent.sh)
(cd ../conf; sudo cp buildAgent.dist.properties buildAgent.properties)
# We need to configure the agent
### Change the TeamCity URL (e.g. "http://teamcity.cloudapp.net") and specify a name (e.g. "monotcagent")
sudo vi buildAgent.properties
### We need to tell the machine to start our agent when it boots, like this:
### #!/bin/bash
### /etc/TeamCity/bin/agent.sh start
sudo vi /etc/init.d/teamcity
sudo chmod +x /etc/init.d/teamcity
sudo update-rc.d teamcity defaults
# Lets compile mono from source (if we aren't happy with the version coming from apt-get mono-complete)
cd ~/
(mkdir code; cd code)
(git clone git://github.com/mono/mono.git; cd mono; git checkout mono-3.0.3)
./autogen.sh --prefix=/usr/local
make
make install
# Make sure NuGet.exe knows whos certs to trust
sudo mozroots --import --sync
# Lets reboot to ensure compiled Mono is system default
sudo /sbin/shutdown -r now
# You can always start/stop the agent manually
sudo /var/TeamCity/bin/agent.sh stop
sudo /var/TeamCity/bin/agent.sh start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment