Building the same source as another Configuration?

I have a Configuration which gets the latest source from a particular branch (say my V1.1 Branch), builds it with MSBuild and deploys the package using Web Deploy to my testing environment. TeamCity then creates a tag in SVN for this build.

Let's say then this deployment passes testing and I want to deploy the same code to my live environment. I can create another Configuration alongside my 'Build and deploy to Test' that is identical except MSBuild is passed a different server path to deploy elsewhere and the VCS root has different labelling rules so tags are created in /reporoot/project/tags/Live.

I then need a way to ensure this configuration always builds the same source that my deploy to test Configuration built. Woudn't this be a 'Checkout Rule' in my VCS settings? I know you can set up snapshot dependencies but that triggers one Configuration from another doesn't it? I don't want a deployment to Live to be automatically triggered in any way obviously.

I thought the 'Deploy to Live' configuration could just publish the 'Deploy to Test' artefact i.e the Web Deploy output package but this won't work as the package needs to be created with different MSBuild options for the purpose of config file transformations between live/test so I may as well just build from scratch again.

Any ideas?

5 comments
Comment actions Permalink

Snapshot dependency works in opposite direction. It does not trigget deployment build automatically after each commit. It ensures there is a fresh build every time you trigger the deployment configuration.
Aslo, it ensures that all build configurations in the build chain check out sources from the same point of time.

0
Comment actions Permalink

Sorry, I'm not sure I unsderstand,


I have 2 Configurations


1. Build Debug .Net configuration from branch V1.0 and package/deploy to Test environment using MSBuild
2. Build Release .Net configuration from branch V1.0 and package/deploy to Live environment using MSBuild


If I set 2 to have a Snapshot Dependency on 1. When I run 2, it runs 1 first then 2, deploying packages to Test and then Live. This isn't what I'm after. When run 2, I want it to run as normal but using the same revision of code that was used when 1 last successfully ran.

Am I missing something?


Thanks

0
Comment actions Permalink

Can you pot live deployment tasks into separate build configuration?
Snapshot dependency between test build and release build allows to compile both version of sources continuously, but do not publish them automatically.
having artifact dependency between release build and live deploy build, you can promote specific version of artifacts to deployment configuration.

0
Comment actions Permalink

I now have a Configuration which builds the packages and another 2 which have Artifact Dependencies on the latest pinned of the first configuration that publishes the packages to Test and Live.

This works well, the only thing that isn't possible is tagging my VCS when a deployment is made as obviously my deployment configurations don't have any VCS root (they just publish already built packages)

This isn't the end of the world as I can see which revision the deployment published checking the link back to the depenedant build. I'd still like to maintain tags in my VCS though every time a deployment is made. Any ideas on this?

0
Comment actions Permalink

Put this task within your deployment script.

0

Please sign in to leave a comment.