WHAT'S NEW?
Loading...
Showing posts with label TeamCity. Show all posts
Showing posts with label TeamCity. Show all posts


Index

  • Intro
  • Index and previous steps
  • Create your new Project in TeamCity
  • Add some configuration to your project

Intro


When someone wants to set up an automatic deployment environment using "Octopus Deploy" for example, previously, he needs to configure TeamCity in order to build the solution.

In this "how-to" guide I'll try to teach you which are the steps to prepare a proper build process in TeamCity.


Index and previous steps

First of all you would need to install the OctoPack nugget package in your .Net solution in order to be detected by TeamCity.

Then push the changes to your repository and now we’ll try to link that repository to your TeamCity solution.
Configuration to build the solution.

Create your new Project in TeamCity

First go to Administration in TeamCity where we'll add our new Project.




Create a new Project within the "Project" option.





Give it a name and paste the URL of your repository. In this case is a Bitbucket repository.





Add some configuration to your project


Once our project is created and linked to the repository, it's time to tune the build process.

Go to the projects list and select our build process by clicking on its name.





In the following window select "Edit Configuration Settings"




In General Settings add a Build number format which, effectively, will be the folder where TeamCity deploy the solution




Within "Version Control Settings" go and edit your VCS configuration.





Add the following text within the "Branch specification":
+:refs/heads/*
+:refs/heads/(feature/*)
+:refs/heads/(release/*)
+:refs/heads/(hotfix/*)
+:refs/(tags/*)
+:refs/pull/(*/merge)
+:refs/pull-requests/(*/merge-clean)


This will make TeamCity run a build process no matter where branch you push to the repository.





Go to the "Build Steps" option where we'll add two new steps:
  • Nuget Installer
  • Visual Studio


For the Nuget Packages copy the following conf.
if you can't see all these options click on "See advanced configuration" at the bottom of the page


Remember to add the name of your solution file within the "Path To Solution File" textbox (this parameter could change from one solution to other).





For the Visual Studio build step do the same as the previous step.





Final step, add a trigger using the default configuration.




Index



  • Intro
  • Problem!
  • Solution


Intro

I've been playing for a while with TeamCity (JetBrains). It is a great tool to manage your builds and put in place continuous integration in your team. But that's not the best part, because the guys from JetBrains don't charge you anything for the professional license which includes all of this:

  • Professional Server License
    • 20 build configurations
    • full access to all product features
    • support via forum and issue tracker
    • 3 build agents included, buy more as necessary


Problem!

It works so good, that you probably forget that it's there. It only happened to me when the disk of the server was getting full. This is produced by the artifacts. The artifacts are the nuget packages we create in our application. They live in our code repository and TeamCity uses them to know what are the results we need to ship.

If you didn't set up a proper cleaning process in your TeamCity box I will show you how.

Solution

First of all we need to login on our instance of TeamCity and the list of projects will be displayed. Select one of the projects and it will take us to another windows where we need to click on the option called: "Edit Project Settings"

On the left menu, click on the option "Clean-up rules". We'll be prompted to a view with our projects, the templates used on those projects and a third column with the clean up setup. Click on "Edit".


In the following window we just need to click on "Custom policy" within the "Clean everything including artifacts, history and statistical data". Then, define the amount of days or the number of successful builds we want to keep as displayed here below:


Finally, we can schedule this task on a daily basis and test it in live as displayed in the following picture within the Administration menu in TeamCity:



That's all, I hope you enjoy the lessons and I'm looking forward to hear your comments.