

#Teamcity artifact paths code
I add artifact dependencies so I can build my source code once and reuse the built libraries in my unit and integration test projects and build a deployment package. Lastly, specify which artifacts you want to go where in the Artifact Rules section and whether you want to clean the destination paths before downloading artifacts.Īs I mentioned earlier, I chain together build projects with snapshot dependencies based on the VCS root I’ve configured in TeamCity. You can choose from Last successful build, Last pinned build, Last finished build, Build from the same chain, or Build with a specific build number or last finished build with a specific tag. In the dialogue, select the build configuration you want the current configuration to depend, then select where you want to get the artifacts. To add an artifact dependency, go to the Dependencies page and click Add a new artifact dependency. You can also make your artifacts a compressed (i.e zip) file.

You have the flexibility to create one or many artifacts and each artifact is made up of one or more files. To configure artifacts go to the General Settings page and enter artifact paths in the Save as Artifacts section. Artifact dependencies are used when you want a build to depend on the output, or part of the output, of a build. TeamCity Artifacts are outputs from a build configuration. Personally, I feel the value of snapshot dependencies dramatically increases when paired with artifact dependencies. I typically select the first two options (do not run if there is a suitable one and only use successful builds) because I want to chain build projects together based on a revision in my VCS. You can also select do not run build if there is a suitable one, only use successful builds, run this build if dependency has failed, and run on the same agent. In the dialogue, select the build configuration you want the current configuration to depend.

To add a snapshot dependency, go to the Dependencies page within the project settings and click Add a new snapshot dependency. Even further, depending on how you set up your dependency options, you could run two or more build concurrently. With this feature, a build process made up of several build steps could be broken into independent projects while still maintaining the build order.

Snapshot Dependencies are a way to chain projects together by ensuring a project is run and finished before the depending project can start.
#Teamcity artifact paths how to
Here, I try to explain the differences between Snapshot and Artifact dependencies in TeamCity, how to add them to your build configuration, and how I have used them and hopefully you will feel comfortable enough to use them too. A little while back I read about TeamCity Dependencies and thought it was a nifty idea but when I started using the feature I realized how powerful they are.
