Publish web application not using OctoPack

I have a multi-project solution, one project is a website which I currently use with OctoPack. The build is hosted on VSTS.

I would like to remove the “octopack” build from the website build as it takes place before the unit tests run, which means it can publish a new package despite the tests failing.

I have the VSTS Octopus extension installed, but I’m having trouble trying to figure out how to get it to package the published package, in the same way that OctoPack does. My “Build Solution” task didn’t have a publish option, so I added /t:Publish but it doesn’t seem to work. It also seems to want to publish every single project not just the web app which makes sense but I’m finding it hard to find anything with google that suggests how to do this. I tried creating a publish profile in the web project, and a test build of just the web app with the build options /p:DeployOnBuild=true /p:PublishProfile=myprofile but this tries failed too.

Hi Howard,

If you have the VSTS Octopus extension installed, then one thing you could do is:

  1. Keep using Octopack, but remove the parameters /p:OctoPackPublishApiKey and /p:OctoPackPublishPackageToHttp. Then add the parameter /p:OctoPackPublishPackageToFileShare. Using this parameter, the package will be sent to a local path on the server, but it won’t be published to the feed. You can read more about how to use this parameter in our docs

  2. Let the tests run.

  3. If the tests pass, run the step Push Packages to Octopus if you are using Octopus as your feed, or the Nuget Publisher step that comes built-in with VSTS if you are using a 3rd party package feed.

Hope that helps,

Many thanks for the idea – that’s worked a real treat!

The build task now has the MSBuild arguments “ /tv:15.0 /p:RunOctoPack=true /p:OctoPackPublishPackageToFileShare=$(Build.StagingDirectory)\octopus “
( I keep octopus packages separate frpom nuget ones)

I also have a windows service project that gets packaged and then I use your Push Packages To Octopus task to send them all to the Octopus server.


Glad to hear it worked :slight_smile: