-
-
Save peterdemin/6496127 to your computer and use it in GitHub Desktop.
Script meant to be used as vagrant shell provisioner.
It doesn't use /vagrant shared folder though.
That means it can be launched from any remote debian machine.
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
#!/bin/bash | |
# Replace this with actual server address | |
serverUrl="10.1.136.242:80" | |
if [ -e "/etc/init.d/teamcity" ] | |
then | |
echo "TeamCity allready installed" | |
exit 0 | |
fi | |
# # Install prerequisties | |
sudo apt-get update | |
sudo apt-get install -y wget unzip openjdk-7-jre-headless dos2unix | |
# Download agent | |
cd ~/ | |
wget http://10.1.136.242:80/update/buildAgent.zip | |
mkdir ~/TeamCity | |
unzip buildAgent.zip -d ~/TeamCity | |
# Configure for using serverUrl | |
sed "s|localhost:8111|${serverUrl}|g" ~/TeamCity/conf/buildAgent.dist.properties | dos2unix > ~/TeamCity/conf/buildAgent.properties | |
# Copy build agent to /var/ | |
sudo cp -r ~/TeamCity /var/ | |
# Add executable permission | |
sudo chmod +x /var/TeamCity/bin/agent.sh | |
# Start build-agent at boot | |
echo "#!/bin/bash" > ~/teamcity | |
echo "/var/TeamCity/bin/agent.sh start" >> ~/teamcity | |
sudo cp ~/teamcity /etc/init.d/teamcity | |
sudo chmod +x /etc/init.d/teamcity | |
sudo update-rc.d teamcity defaults | |
# Launch build agent | |
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