Skip to content

Instantly share code, notes, and snippets.

@kjellski
Created April 24, 2015 21:35
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 kjellski/f965f53c6ceebe3f1353 to your computer and use it in GitHub Desktop.
Save kjellski/f965f53c6ceebe3f1353 to your computer and use it in GitHub Desktop.
TeamCity Installation
#!/bin/sh
# /etc/init.d/teamcity - startup script for teamcity
export TEAMCITY_DATA_PATH="/usr/local/.BuildServer"
case $1 in
start)
echo "Starting Team City"
start-stop-daemon --start -c teamcity --exec /usr/local/TeamCity/bin/teamcity-server.sh start
;;
stop)
echo "Stopping Team City"
start-stop-daemon --start -c teamcity --exec /usr/local/TeamCity/bin/teamcity-server.sh stop
;;
restart)
echo "Restarting Team City"
start-stop-daemon --start -c teamcity --exec /usr/local/TeamCity/bin/teamcity-server.sh stop
start-stop-daemon --start -c teamcity --exec /usr/local/TeamCity/bin/teamcity-server.sh start
;;
*)
echo "Usage: /etc/init.d/teamcity {start|stop|restart}"
exit 1
;;
esac
exit 0
original scripts here:
https://gist.githubusercontent.com/sandcastle/9282638/raw/teamcity-install.sh
https://gist.githubusercontent.com/sandcastle/9282638/raw/teamcity-init.sh
#!/bin/bash
cd /
# install server dependencies
sudo apt-get update
# install ppa
sudo apt-get install -y python-software-properties
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install -y oracle-java8-installer
sudo apt-get install -y curl
# install build agent dependencies
sudo apt-get install -y git
# install team city
sudo wget -c https://download.jetbrains.com/teamcity/TeamCity-9.0.3.tar.gz -O /tmp/TeamCity-9.0.3.tar.gz
sudo tar -xvf /tmp/TeamCity-9.0.3.tar.gz -C /usr/local
sudo rm -rf /tmp/TeamCity-9.0.3.tar.gz
sudo mkdir /usr/local/.BuildServer
# create user
sudo useradd -m teamcity
sudo chown -R teamcity /usr/local/TeamCity
sudo chown -R teamcity /usr/local/.BuildServer
# create init.d script
sudo wget https://gist.githubusercontent.com/sandcastle/9282638/raw/teamcity-init.sh -O /etc/init.d/teamcity
sudo chmod 775 /etc/init.d/teamcity
sudo update-rc.d teamcity defaults
# download postgres
sudo mkdir -p /usr/local/.BuildServer/lib/jdbc
sudo mkdir -p /usr/local/.BuildServer/config
sudo wget http://jdbc.postgresql.org/download/postgresql-9.3-1101.jdbc41.jar -O /usr/local/.BuildServer/lib/jdbc/postgresql-9.3-1101.jdbc41.jar
sudo wget https://gist.githubusercontent.com/sandcastle/9282638/raw/postgres.database.properties -O /usr/local/.BuildServer/config/database.properties
# ensure owership
sudo chown -R teamcity /usr/local/TeamCity
sudo chown -R teamcity /usr/local/.BuildServer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment