Is it possible to build a custom step template based on a deployment step?

One of our deployments has a nested step that does the following:

Step 1 - Installs a tool from NuGet (deployment step)
Step 2 - Installs some config files from NuGet (deployment step)
Step 3 - Runs a custom step template that has a bunch of PowerShell (with parameters)

The problem is that this meta-step (these three steps) are used in almost all our projects. I could consolidate the two deployment steps, but it still leaves the problem of the PowerShell. What I want is a single custom step template that installs something from NuGet, but has additional parameters that I can use in a PowerShell script. Something like a composite step, or a custom deployment step. Using features from a deployment step would also work, but because it’s not in a template, I can’t maintain it across projects.

Is there some way to invoke a deployment from a custom step template (and get the retention, install paths, etc)? Or is there some other approach that I can use?

Thanks,
Erick

Hi Erick,

Thanks for getting in touch! If I am understanding this correctly I think you can solve the problem by using our deploy.ps1 conventions.


There are a number of PowerShell scripts we will look for in your package and run them based on ordering based on name. If you see in the above link it shows you when they are run.
Could this solve the final part of your problem?

Vanessa

Thanks for the response Vanessa.

It doesn’t really help, as while it does allow for all the work to be in a single step, that step can’t be used as a template. The idea is to make sure that everyone who is deploying a particular package performs the same set of actions after deployment. Without a template, the latter part can’t be enforced.

What I was thinking for the second question is if there was a way to have a PowerShell/C# template that could do the package deployment (while still getting the retention period, etc).

Thanks,
Erick

Hi Erick,

Why do you think it can’t be used as a Template? The Nuget Package step is a template type. It works the same way in the project? So long as all the packages have that file?
Could you explain more why you think it can’t be used as a template? I am missing something I think :slight_smile:

Vanessa

Hey Vanessa,

I must apologize - I’ve somehow missed that the entire time I’ve been working on this problem! For some reason in my head I thought you could only have step templates in C#/PowerShell/Bash. This will work perfectly. Thanks for pointing it out - it saved me many hours of work and a load of tech debt.

Thanks!
Erick

Hi Erick,

Happy to help! Let me know if I can be of further assistance.

Vanessa