Deploy two projects on the same machine sequentially

Hello,

We are deploying two Octopus projects at the initialization of our EC2 instance using the below logic:

OctopusProjectArray="proj1, proj2"
foreach ($strProject in $OctopusProjectArray){
        c:\octopus\Octo.exe deploy-release --version=$ver --project=$strProject --deployto=$octopusEnvironment --server=${pOctopusServerURL} --apikey=$octopusAPIKey --specificMachines=$machineHostname
}

So basically this runs the deploy-release for our two projects pretty much at the same time and hence both projects are deployed at the same time.
But we would like to only deploy proj2 once the proj1 deployment has been completed.

If anyone has any idea on how / if this could be achieved, that’d be great :slight_smile:

Can we get the status of an Octopus deployment via command line for example ?

Thanks a lot

Hi @kevinz,

Thanks for getting in touch! It looks like you’re after the --waitForDeployment flag for the octo.exe deploy-release command. We have a list of the different options available on the documentation I have linked, but here’s the text for this one:

      --waitForDeployment    [Optional] Whether to wait synchronously for
                             deployment to finish.

I have done a quick test on my end with the foreach loop in your example and it worked great for me. Just append it anywhere in the command and it will wait for each deployment to complete before starting the next loop.

Let me know if this helps or if you have any further questions at all.

Best regards,
Daniel

That’s perfect, this is exactly what I was looking for. Thank you :slight_smile:

1 Like

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