Octopus integration with TFS Build vNext
If you're an Octopus Deploy user who uses Team Foundation Server or Visual Studio Online, you're probably very familiar with OctoPack. It's a tool that hooks into your MSBuild process to package your project ready for use with Octopus.
Right now, the CI process for a project in TFS involves using OctoPack to package and push your application, then Automatic Release Creation to create a new release as soon as you push to Octopus, and finally a Lifecycle that will automatically deploy that release to an environment. There's a walkthrough on our Training Videos page if you want to learn more.
This scenario works really well for 90% of projects, but it blurs the line between the build and deploy stages of your process. These stages should really be separate. For example, if your build succeeds but half your integration tests fail, would you want a deployment to happen?
If you're sufficiently dedicated, you can modify build process templates to add additional steps, but nobody wants to work with this:
Team Build vNext
Thankfully, Microsoft has put a lot of effort into replacing Team Build. If you're a Visual Studio Online user, or you've played with one of the TFS 2015 Prerelease versions, you might have seen the new Build.Preview option in the menu (it's going to be combined into the existing Build option very soon).
If you want to know how it works, Chris Patterson gave a great walkthrough at //build/ this year, and Microsoft has made some information available online.
As a long-time TFS user, I'm very confident you'll want to move to the new Build system as soon as you can.
The new structure of Team Build gives us a great opportunity to integrate better with your build process. To that end, we've created a new, public OctoTFS repository in GitHub.
It currently contains two options for creating a Release in Octopus as an independent step in your build definition. Both of them let you separate the build and deploy phases really nicely. Note that you'll still have to package and push your Nuget package to the Octopus Server (or another Nuget repo) - these steps just create releases. You can still use OctoPack for packaging and pushing.
The integration I'm most excited about is the custom Build Step. It gives you a really nice UI and even includes release notes pulled from changesets and work items - something we get asked for a lot.
Unfortunately, because you need to upload the package to TFS/VSO, it won't be available to use until the new build system hits RTM. That shouldn't be too far away. At least this way you'll be able to use it from day one of RTM instead of having to wait!
Update: The Custom Build Task can be uploaded using the
TFX-CLI tool. Instructions can be found on the GitHub page
The other option is a PowerShell script you can include in your project. This one you can use right now, and it works nearly as well (no release notes yet). It's not quite as nice to work with, but it does the job for now.
We will continue to work on these integrations so they're useful and easy to use for as many people as possible. Our priority is always going to be on the core product though, so we'll improve and add when we can.
Of course the OctoTFS repository is open source, and we will be accepting pull requests, so if you see a bug, a potential improvement, or even a completely new integration option, we'd love your contribution!
Other TFS Integrations
I anticipate we'll start building a few more integrations with TFS in the future. Microsoft is starting to open up some awesome opportunities with the REST API, Service Hooks, and even Extensions. Octopus dashboard inside TFS anyone?