Best way to create new releases from "Master project"

I have a “Master project” with Deploy Release steps. So my setup is as follows:

Projects

  1. Master
  2. Project A
  3. Project B
  4. Project C

I have a Lifecycle DTAP with auto triggers on D and T, so the moment I create a release for Project A, it will auto deploy to DEV, and TEST.

I do not have a setup for Automatic Release Creation, because I push too much packages and I want to have more control.

However, I want to deploy A, B and C at once (or at least sequentially), without too much clicking.

What is the best way to do this?

Currently I have a powershell script in Master that tries to create releases but that one is not working. Maybe I should use the REST Api?

But I would like to have a general advice. Is this the correct way to do this?

My Master project has the following steps:

  1. Create releases (for project A, B, C)
  2. Deploy release project A
  3. Deploy release project B
  4. Deploy release project C

As you probably see, I also have challenge with the auto triggers right?

PS: I use a variant of this snippet

One problem is that version stays empty. Probably because I use package versioning?

Hi Gerjan,

Thanks for getting in touch! The problem you’re likely hitting is due to the fact that when creating a release of a master project, the releases of the “child projects” (Projects A, B and C) have to already exist. You select the releases of these projects when creating a release of the master project (like how you select existing package versions for package steps) which are then included in that release snapshot.

Perhaps the best current option here if you’re wanting all this done in a single deployment process would be to use the Chain Deployment step template written by the community. This step has a parameter to create a new release of the project you’re targeting in the step.

https://library.octopus.com/step-templates/18392835-d50e-4ce9-9065-8e15a3c30954/actiontemplate-chain-deployment

In the past we’ve considered, but decided against adding the ability to create releases directly in Deploy a Release steps. However we’re interested in hearing more about your scenario, as perhaps there’s a valid use case we should accommodate for. Would you be willing to expand a bit on the relationship between these projects, and the reasons why creating the releases directly in the deployments is preferable?

I hope this helps for the time being, and I look forward to hearing back!

Best regards,

Kenny

Thanks, I am trying that Chain Deployment step template now… One downside is that its not first class supported in de UI

But the option you suggest would be awesome! Give Deploy a Release step an option to create a new release (from my project Release Versioning setting, a package version)

I have several independent / semi-dependant projects, so normally I will deploy them independently. But sometimes I just want to update a bulk of projects, because I know I need to update them all. This is especially the case for certain Tenants.

Okay I came to the conclusion that the Chain Deployment does not work for me.

So my question remains: How can I create a Release via Powershell Script?
I am able to do this with octo.exe, but Powershell does not seems to work.

Do you have a Powershell or Rest API example?

What I am planning to do:

  1. Create Releases (Powershell)
  2. Deploy Project A
  3. Deploy Project B
  4. Deploy Project C

I think this should be possible right?

Hi Gerjan,

Thanks for keeping in touch. That’s unfortunate that the Chain Deployment didn’t work for you! We have a sample script in PowerShell to create a release of a project directly via the REST API that I think should give you a good starting point.

The releases of your child projects need to be created before creating the release of your master project. Child project releases are treated in basically the same way to packages and their versions, where a package version that you want to deploy has to be available prior to creating the release. This means your Create Releases (Powershell) step would have to exist outside of the master project.

Regarding the enhancement idea to allow creating releases of your child projects in this step, there’s an existing UserVoice suggestion to implement this that I’d recommend giving some votes to.

The comment in that suggestion sounds like it might help in your case as well.

“Here’s what I did >>> In the child projects, set up a trigger to auto-release. Then when you go to create a release from the project that contains the “Deploy a Release” step, it will have all the latest releases available.”

I hope this helps out! Let me know how you go or if there’s anything else I can assist with.

Best regards,

Kenny

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.