Recently started using octopus deploy as part of our ALM process. It really make the whole deployment process a lot easier, and I may write later on this blog about it. I wanted to have our build process and versioning done in TFS, and have the build publish packages to octopus.
There are many way to accomplish the task. Here is what we have ended up with.
- First, make sure that every project you want to publish have a nuget reference to Octopack.
- Now create a new empty build process
- Go to the vs marketplace and install Octopus plugin for tfs.
- Add the following tasks to your build (you can ignore the tsbuild task, it is part of a custom build we do with our ts files)
- Select Get sources, and make sure you have clean output directory selected in clean options. If you do not, your bin folders will contain multiple package versions, this will increase publish time to octopus.
- Now select the run Build solution task
- Set msbuild arguments to the following
/p:RunOctoPack=true /p:OctoPackEnforceAddingFiles=true /p:OctoPackPackageVersion=$(Build.BuildNumber)
- Select push packages to octopus task and configure it like this
- Now select the create octopus release task and add configure it..
- Now under options -> build number format, make your build number format semver compatible
There you go, you now have your versioned packages published from tfs to octopus, ready to deploy!