Deploying Multiple Websites In The Same Project

I have a CI build in a local TFS server that build multiple projects in a large-ish solution.

The output of this is a WCF service and two dependant web applications. Each gets packaged into it’s own nuget package and sent to the Octopus repository.

I have created a project which automatically creates a release and published to our staging environment.

Today I noticed one of the sites was wrong and when I looked at the log the release had started when the first nuget package (the WCF service) was pushed but the two websites were published with old versions because they had not completed building.

The audit records went something like:

Package Wcf.Web version 1.4.5569.26662 was pushed to the builtin feed
MyProject release 0.0.3 was automatically created because package Wcf.Web was pushed to the builtin feed
Package SiteA.UI version 1.4.5569.26673 was pushed to the builtin feed
Package SiteB.UI version 1.4.5569.26709 was pushed to the builtin feed

*names project names have been changes to protect the innocent :slight_smile:

Is there a way of making the Project wait until all three packages hit the repository? All three are part of the same CI build and so should always be published together.

Cheers,
Nick

Hi Nick,

Thanks for reaching out! Unfortunately there no way currently of telling Octopus to wait for the 3 packages to arrive before starting the release. On these scenarios the best is to add a step at the end of the build process where you call Octo.exe to create the release and deploy it. You just need to make sure that the Octo.exe step only runs if all the previous steps (the 3 compilations) are done successfully.

You can get Octo.exe from our website: https://download.octopusdeploy.com/octopus-tools/2.6.1.52/OctopusTools.2.6.1.52.zip

Hope that helps!

Dalmiro

Hi Dalmiro,

I’m using TFSBuild in TFS 2010 so I’m not sure how I can tell Octopack to wait.

The build arguments I’m using are:
/p:RunOctoPack=true
/p:OctoPackPublishPackageToHttp=http://att15dev02:8080/nuget/packages
/p:OctoPackPublishApiKey=MY_KEY_GOES_HERE

Would I need a completely custom build template in order to sort this?

Cheers,
Nick

Hi NIck,

The build arguments you are passing down are perfect to upload the package to your NuGet feed. What you’ll be needing now is an extra step on your build template that executes Octo.exe only if all the previous msbuild calls were successful (meaning all the projects where compiled, packed and uploaded without issues).

This blog post provides a very good guide on how to add a Powershell step to you build process:

http://www.ewaldhofman.nl/post/2010/11/09/Part-14-Execute-a-PowerShell-script.aspx

As for calling Octo.exe, you’ll be needing to use the parameter Create-Release

Hope that helps!

Dalmiro