In the effort to improve release throughput we’re running a pilot to move SQL deployments from a dedicated tentacle to a pool of workers. As part of the conversion we’re disabling project steps based on the old template and creating new project steps based on the new deployment template for our projects. Ideally we’d like the new project step to be immediately after the disabled step, so the deployment order is preserved. Given the number of projects in scope (literally hundreds) doing this manually is not practical.
The one thread I found on this (“Reordering steps using power shell”) doesn’t point towards a solution; however I’m curious if there’s a mechanism for this now. Thanks.
I’ve done something similar to this recently, but it ends up being VERY context dependent on your steps. It’s not exactly the cleanest, but it works! I’m happy to share the bones of the script that I wrote, which can at least point you in the right direction of how to start approaching this. Can you tell me some more about your current template step and what you’re hoping to move to? That’ll help define the structure of how it would be scripted out.
The broad strokes of how it works:
Iterate through your projects and their deployment processes, looking for those that have deployment steps matching the type expected
Create your new step, pulling over any relevant data from the prior step and setting sane defaults for anything that isn’t a 1:1 match between steps
Add the newly built step in after the index of the previous step, then disable the previous step
POST the new deployment process for the project to update it with the new values
Thanks for the quick response! Essentially I coded the process (disable the old step, create the new one based on the new template and copied over the old step settings); however when I add the new step it always puts it at the end ( I want it after the disabled step). Any coding samples would be super helpful.