0
votes

I would like to run some initialization code in release pipeline, before first target is deployed. At the moment I have to use stage, and there are various downsides to this approach (my stage is triggered automatically, so I cannot remove it, because it is "deployed" to init stage, also init takes space in deployment stages).

It is possible to run steps without stage in release pipelines?

2
Can you tell more what you want to do in this init? - Krzysztof Madej
The main point is set release name, based on build artifact - Shadow

2 Answers

1
votes

Azure release pipeline provide Approvals and Gates which give you additional control over the start and completion of the deployment pipeline.

There are some tasks you can use in Gates to check with other automated systems until specific conditions are verified before deploying to deployment stages. So you can check if the init steps you want to run before first target is deployed can be achieved with the options provided in Gates.

Otherwise the steps cannot be run outside a stage.

The workaround is to add an additional agent job(you can name it deploy-init job) to the top of your deployment stages. And run the init steps inside the deploy-init job.(Or you can just add some tasks to run the init steps within the deployment stages).

enter image description here

As above screenshot shows, To add an Agent job(Deploy-init) inside Deployment stage, click the plus + to add tasks to run the init steps. (You can drag and drop the agent jobs to change their order).

0
votes

To run a step you ned a job. And if you need a job you need a stage. Unfortunately you can't run a step without a stage.