Monday, March 19, 2018

How to configure pipelines in Teamcity - Create Pipelines in TeamCity - Integrate with Tomcat and SonarQube

Let us see how to create pipeline using Teamcity.


1. Project is set up either in Bitbucket or Github or which ever the repository you use.
2. user to perform admin task in teamcity.
3. Tomcat set up and running for deployment with username and password configured in tomcat-users.xml


1. Click on Administration in Teamcity
2. Click on Create project
3. Choose Repository URL
4. Enter repo url from Bitbucket or GitHub
5. Enter bitbucket credentials - username/password

6. Now it will show the project
7. Click on Proceed.
8. Pick the project for the build steps
9. Edit maven goals as clean install.
10. Now add another build step
Choose Container deployer.
11. Enter hostname:port for tomcat. do not put http before hostname.
username as tomcat and password for tomcat
12. Click on Save
13. Now click on Run

Click on Build Log to see any error.

After build is successful, make sure you are able to access the webapp in Tomcat.

How to setup SonarQube plug-in in TeamCity:

Now let us see how to integrate with SonarQube:

1. Click on another Build step 
2. Add SonarQube Runner 
3. Click on SonarQube Servers tab
4. Click on Add New server 

5. provide name, URL and login info.
6. Now go back to build steps
7. Add SonarQube server
8. give MyWebApp as source location.
9. Now run the build. it should integrate with Sonarqube

No comments:

Post a Comment