A couple of weeks ago I posted about integrating Deployment Manager’s RgPublish command line with TFS. These scripts have now been extended to support calling the DeploymentManager command line to trigger deployments automatically after a build. This is great for deploying to a shared development or test environment such that the whole team has somewhere to go to view the latest version of your software.
These changes are hot off the press, so do create issues or pull-requests as helpful, and I’ll do my best to review and integrate them.
Version numbering of multiple components and the release may be interesting when using TFS. Release version numbers need to be unique. Let’s say you have a simple case of a web app and database:
- Web app builds, it will create a package versioned eg. 184.108.40.206.
- Database builds and produces a package versioned eg. 220.127.116.11. (Your latest web app package is still 18.104.22.168.)
There are two possible solutions to this:
- Have a separate build for the release creation and deployment. Trigger this on successful build of either web app or database. The version number sequence is then always incremented. This is the approach we use on our demos using TeamCity, and is the recommended approach. A drawback is that the version number of the release will not match exactly the build number of the web app. But you could easily ensure the major version number matches.
- Setup a dependency for the web app on the database so that whenever the database component builds, a web app build follows. Then the auto-deployment can be triggered from the web app only. A drawback is that the web app likely doesn’t have a strong dependency on the database, and doesn’t need to be rebuilt. This means publishing duplicate packages for the web app. It also doesn’t scale well with multiple dependencies, as there would be even more duplication.
But it doesn’t look like TFS supports either successful build triggers or build dependencies, out-of-the-box. I’d be interested to learn what approach you take when implementing this, or any approaches you’re taking to solve similar problems.