Skip to main content

Trying @teamcity for #ContinuousIntegration - Part 1

Teamcity is a continuous integration software application from JetBrains. I am a Jenkins expert. I use it at work and I go deep into it with custom plugins and custom code to orchestrate builds and deployments. I use CircleCI and TravisCI for my github projects and these are just for fun. All these products are good in their own way. Jenkins is the mother of all CI tools. CircleCI and TravisCI are simpler to use and I really like the speed and agility of these tools. I would use Jenkins for enterprise and CircleCI/TravisCI for open source public domain projects.

I didn't realize that there is a free version of Teamcity until last night and the features are fairly decent. There is a 50% discount for startups and free for open source projects. This is welcoming.


Installation

Jumping right into it. I downloaded the windows version and the installation was fairly simple with the executable, but I could not get it to work. The browser would just show a blank page. I quickly switched over to my favorite way of doing things - Docker - and it worked right away.


docker run -d --name teamcity-server-instance \
-v $HOME/docker-shares/teamcity/server:/data/teamcity_server/datadir \
-v $HOME/docker-shares/teamcity/logs:/opt/teamcity/logs \
-p 8111:8111 \
jetbrains/teamcity-server



Open http://localhost:8111 and you see a very welcoming 'Teamcity First Start' page.


















I kept the installation simple. I chose the internal database option for the database and accepted the license agreement. I created a user account on the next form and I was brought to the settings page which shows off some pleasing features like:


  1. Version control integration
  2. Email, Jabber, IDE and Windows notifier
  3. Some popular plugin choices and tools on the right


















Hello Teamcity

Step 1: Click on 'Projects' link on the top left and click 'Create Project' - 'Manually'.
















Step 2: Enter project details and click 'Create'




Features observed: Very interesting feature titles that I will explore later.


  1. Build Configuration Templates
  2. Subprojects





















Step 3: Build Configuration


Click 'Create build configuration' - 'Manually'.
























I came this far to realize that I cannot do a simple 'echo "Hello Teamcity"'. I have to integrate with a version control system to proceed with this trial.



















Step 4: Integrating with Github


There are two tiny icons below the 'Repository URL' textbox for github or bitbucket. I chose github because I have a few projects there that I could build easily. Click on the 'Github' icon.













We have to register our local teamcity instance with GitHub. This was easier to do on Jenkins, CircleCI and TravisCI.






















Click 'register Teamcity' and create a new application token on GitHub. Just copy paste as stated in the screen above.





















When you click 'Register application', a new client id and client secret are created. Copy paste from github page to the teamcity github connection page and save. This takes you to a connection page instead of taking you back to your project configuration page. Just use the browser's back button to go back to your project configuration page. Now, the github icon will be showing as enabled.

Click on the github icon and sign in with your github credentials.












Step 5: Select project to build and trigger the build


I have a marstime github project. It is a maven project with java code. It is not perfect, not accurate and it is not well written. But, it compiles and runs.
















Select the github project and click create.

























Step 6: Run the build




Click on the dotted button next to 'Run'. Select 'run as a personal build' and 'clean all files in the checkout directory before the build' (Just some good CI habits). Then click on 'Run Build'.
















I was expecting teamcity to start building this code like Jenkins does on the master when it does not have agents. That didn't happen on teamcity. I clicked on 'Run' three times. Now there are three builds in the queue.














I'll have to create a teamcity agent docker container and hook it up to this teamcity server. Coming soon in part 2 of this blogpost.

Popular posts from this blog

A @trello board to get kids excited

My 8 year old just started his summer break. He did so well in school and I am proud of him. He skipped second grade, got into the gold honor roll in every quarter and got a medal for doing that. Last night, I promised to install a new app for him on his iPad mini. I installed Trello and created a board for him while he watched. I showed him how to create cards, add labels to them and move them from To Do, to Doing to Done. I had him create some cards and label them. He could not stop creating cards. I could not convince him to go to bed after that. He created cards for everything he wants to do in the summer and he is not done with creating cards. He even created a card to email a screenshot of his Trello board to his teacher.

Later last night, he was still awake in bed when I checked on him. He told me that he wanted to add three more labels - Math, Science and One-on-One. He wanted a label titled 'One-on-one' for tasks that he wants to do with me and he wants one-on-one att…

A @trello board to get kids excited - continued

This is a continuation of the previous post titled - A trello board to get kids excited. At the time of writing this post, the previous post had 198 page views. I wish people commented. I did get some positive feedback on Twitter. The Trello twitter account re-tweeted my tweet and also sent out a second tweet advertising the page. Thank you very much. I hope a lot of parents and kids benefited and had fun as a result.

Trello people: Idea - How about a 'Trello Kiddo'? Perhaps you could offer that to schools that give iPads for each kid to take home with them. Get them when they are young.

When a kid does something religiously, regularly and feels great about it and can't wait to tell everyone about it, you know you've done well as a parent. We realized that we needed a separate column to keep track of 'Special accomplishments'. Positive reinforcement that you can see with your eyes!

Some parents feel like they haven't done enough for their kids, particularly…

#Git starter cheat sheet

Initialize a local repo Run the following command in the folder where you would like to initialize a git repo.
git init
Get status It is a good practice to frequently run check on status during development. The following command points out the changes between the previous commit and current state of the folder.
git status
Add content To add an untracked file named ‘text.txt’ to the staging area, execute the following command.
git add text.txt
Syntax: git add <filename>
Commit changes To commit changes made to the folder, execute the following command. The message will be used as a commit message to associate this check-in with the message.
git commit –m “Add text.txt to the code base.”
Syntax: git commit –m “<Commit message>”
Add using wild card To add multiple files using a wild card character, execute the following command.
git add ‘*.txt’
Syntax: git add ‘<wildcard_character+string>’
Check history Review commit history using the following command.
git log
Add Remote re…