Skip to content

Instantly share code, notes, and snippets.

@lukehutton
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukehutton/9477121 to your computer and use it in GitHub Desktop.
Save lukehutton/9477121 to your computer and use it in GitHub Desktop.
Install TeamCity Build Agent on Ubunutu 12.04
# install dependencies
$ sudo apt-get update
# jre headless (no gui)
$ sudo apt-get -y install openjdk-7-jre-headless
# download TeamCity agent
$ wget http://myteamcityserver/update/buildAgent.zip
$ unzip buildAgent.zip -d buildAgent
$ cp buildAgent/conf/buildAgent.dist.properties buildAgent/conf/buildAgent.properties
$ chmod +x buildAgent/bin/agent.sh
# update serverUrl=http://myteamcityserver and name=mybuildagent
$ vim buildAgent/conf/buildAgent.properties
# add teamcity user
$ sudo -s
$ useradd -m teamcity
$ usermode -a -G openssh teamcity
$ passwd teamcity
# generate ssh key for git access
$ ssh-keygen -t rsa
# create config file /home/teamcity/.ssh/config
# move buildAgent to /home/teamcity/agent
$ sudo mkdir -p /home/teamcity/agent
$ sudo cp -r buildAgent/* /home/teamcity/agent
# cleanup
$ rm -rf buildAgent.zip buildAgent
# create the start script - see https://gist.github.com/lukehutton/9477210
$ sudo vim /etc/init.d/teamcity-agent
# grant permissions and add it to the startup process
$ sudo chmod 755 /etc/init.d/teamcity-agent
$ sudo update-rc.d teamcity-agent defaults
# reboot and test
$ sudo /sbin/shutdown -r now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment