psfinaki
psfinaki

Reputation: 2132

Is there any way to simulate dynamic YAML pipelines in Azure DevOps?

What I'm thinking about is to have a step in the pipeline to generate a full-blown pipeline to run afterwards.

Apparently this particular thing is not there yet (feature requests here, here). But maybe somebody has some fresh thoughts on workarounds?

Upvotes: 3

Views: 1949

Answers (3)

FabianTe
FabianTe

Reputation: 649

I agree with Daniel here, that it is simply a reality of pipeline development that you have to commit, run, repeat a lot.

This has led me to build more complex pipeline steps as standalone shell scripts which I can test by setting environment variables. This will allow you to kind of simulate how a pipeline would potentially run.

This comes in handy for example when you rely on git metadata (branch / tag / refs in general) to create a build identifier or docker image tag.

Upvotes: -1

Carl in 't Veld
Carl in 't Veld

Reputation: 1503

For the dynamic work you could set up a repo with one dummy yaml file and a pipeline registration that targets this yaml file.

From a static pipeline that is responsible for kicking off a dynamic pipeline you then execute two steps:

  1. Create a fresh branch of that "dynamic" yaml file and commit the required dynamic workload

Not sure about branch limits though. You could also decide to reuse a branch.

  1. Kick off this "dynamic" pipeline through az devops cli using the static pipeline's access token

Also see the following documentation: https://learn.microsoft.com/en-us/azure/devops/cli/azure-devops-cli-in-yaml?view=azure-devops

Upvotes: 0

Daniel Mann
Daniel Mann

Reputation: 58981

Not really. It's a pain that's just a fact of life when working with YAML pipelines. It's especially annoying when trying to work through runtime vs compile time variable resolution issues.

Commit, run, commit, run, commit, run, over and over.

Upvotes: 5

Related Questions