Reputation: 1140
I've been reading the following two links to grab the idea of the snapshot dependencies.
https://confluence.jetbrains.com/display/TCD8/Build+Dependencies+Setup http://blog.jetbrains.com/teamcity/2012/04/teamcity-build-dependencies-2/
But I just want to make sure I understood correctly what I read from them. So can someone explain it in a easy way please if possible?
Upvotes: 1
Views: 158
Reputation: 156
From my understanding the main reason using Snapshot Dependencies is for gain access to build parameters from builds that you depend on, by %dep.<buildName>.xxxxx
.
For example, is you have a project MyProject with a Compile config, a Package config and a Upload config. I would set Package to have a Snapshot dependency on Compile and Upload to have a snapshot dependency on Package:
MyProject
Compile <- Package <- Upload
Then, if you run the Compile Job (passing in a version parameter) the Package and upload configs get added to the build queue, but will run in order once the build it is dependent on have built.
As it is a Snapshot dependency Package can also access Compile's build parameter (version) by using %dep.MyProject_Compile.version%
. Also because Upload has Package as a snapshot dependency it can also access it from the same location (%dep.MyProject_Compile.version%
).
If you just ran an Upload config (say it failed and you fixed it and wanted to rerun), then only the Upload job will run - with will not trigger Compile and Package.
Note: I am relatively new to TeamCity (used Jenkins for years before and there are some big differences when chaining builds/config).
Upvotes: 1