Last active
August 29, 2015 13:57
-
-
Save lukehutton/9477121 to your computer and use it in GitHub Desktop.
Install TeamCity Build Agent on Ubunutu 12.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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