Nowadays, application development is usually done at a fast pace when many developers are working on the same part of code. Sometimes this becomes a real challenge if there’s no permanent control over consistency of the project source. Continuous Integration is a well-known life saver for distributed development environments with TeamCity being one of the best and easy-to-use instruments utilizing it. This article describes the process of installing and configuring the TeamCity CI server on Ubuntu 14.10.
Let’s start with downloading and unzipping the latest version of TeamCity. Type this into your command line:
Let’s start with downloading and unzipping the latest version of TeamCity. Type this into your command line:
wget http://download.jetbrains.com/teamcity/TeamCity-8.1.4.tar.gz
mkdir /srv/www
tar -xvzf TeamCity-8.1.4.tar.gz -C /srv/www
Create and
configure TeamCity startup file:
touch /etc/init.d/teamcity
#!/bin/sh
# /etc/init.d/teamcity - startup script for teamcity
export TEAMCITY_DATA_PATH="/srv/www/TeamCity/.BuildServer"
case $1 in
start)
start-stop-daemon --start -c www-data --exec /srv/www/TeamCity/bin/runAll.sh
start
;;
stop)
start-stop-daemon --start -c www-data --exec /srv/www/TeamCity/bin/runAll.sh stop
;;
esac
exit 0
Then we have to install the latest Java Developers Kit and Apache in our Ubuntu server:
apt-get install openjdk-7-jre
apt-get install apache2
For
example we will try to set TeamCity for .NET project placed in .hg repository.
So we have to install Mercurial and Mono packages:
apt-get install mono-complete
apt-get install mercurial
Now
restart you Ubuntu virtual machine and point your local browser to http://127.0.0.1:8111 (You can
change 8111 port to 80 one in /srv/www/Teamcity/conf/teamcity.properties
configuration file).
Now create your first teamcity account.
Then you need to configure the first project. In fact, you'll go through these steps for each project, but some settings may change from one project to another. TeamCity needs to know how you will refer to the project. This does not have to be the same name as your project. Enter the name and description for the project then click Create.
Now that you have created the TeamCity project, you need configure it. This is probably the most difficult part of setting up a new project as you need to decide things like the build number format and what to do if a build fails. Let’s create the Build Configuration and go to VCS settings.
Once you have configured the build options for the project, you must configure the connection to the Version Control System (VCS, your source code repository. The source root configuration varies depending on the source control system you are using. As we are using Mercurial we will have to provide at least the Mercurial URL, username, and password. The newly created source control root will be added to the project configuration.
The next step is the build runner configuration. The build runner is a tool that will perform your build. TeamCity comes with a bunch of runners.
To make TeamCity automatically trigger the build every time something new is detected in the source control repository you will have to check Enable triggering when files are checked into VCS flag. You can enable quiet period detection there. You can configure the build dependencies for your project.
If you configured everything correctly you have your first continuous build with TeamCity ready and it should be visible on the projects overview page.
No comments:
Post a Comment