0
votes

My setup in TeamCity:

I've got a "CI configuration" running a singular build step that uses a MSBuild script checked-in to the from the project. The configuration has a number of sub targets such as unit tests, deployment to test site etc.

I also have a "Deploy configuration" with a singular target using another MSBuild script that only does deployment (using msdeploy). This is triggered manually.

My problem:

The "Deploy configuration" need to deploy a revision based on the latest pinned build from "CI configuration". The whole idea is essentially to get a one-click-deployment functionality based on latest pinned build in CI. Does anyone know how to do this in MSBuild using TeamCity?

Im guessing I need to use "Snapshot Dependencies" to get the latest pinned revision, but I have not been able to figure out how to deploy that snapshop in the MSBuild script.

Also I'd like to specify that I would like to do this within MSBuild script and not by using the "Custom build" dialog in TeamCity.

1

1 Answers

0
votes

Ok, figured it out on my own.

You need to set a row in the "Artifacts path" like so "*/ => source" in the CI configuration.

Then add a "Artifact dependency" in the Deploy configuration pointing to the CI configuration in the "Depend on" select and set "Get artifacts from" to "Last pinned build" and then point to the "Artifact rules" like so: "source => source".

And at last, inside my MSBuild file, I added "/source/", to my project path in the Target-node with the deploy.

Works like a sharm every deployment. :-)