I have an azure devops build pipeline that builds some docker images and a release pipeline that deploys the docker images using some artifacts I publish in the build.
In the build I have some parameters that allow the user to change which docker images are built. Defined like this:
parameters:
- name: docker1
displayName: Build docker image 1?
type: boolean
default: true
- name: docker2
displayName: Build docker image 2?
type: boolean
default: true
I now want to make jobs in my release stages dependent on these variables as well.
So something like this:
Now the config in this picture doesn't work.
My question is how does the syntax for this work if this is just a problem of syntax or how do I make these parameters available to the release if this is more of an issue of variable scope?
What I've tried:
- Just accessing the parameters with the syntax shown above
eq('${{ parameters.docker1 }}', true)
- Specifying the Build like one would with predefined variables of the build scope
eq('${{ Build.parameters.docker1 }}', true)
- looked at variable groups vaguely based on this post Azure DevOps Build and Release pipeline artifact name variable . Variable groups seem to be immutable from the build pipeline and also shared between multiple potentially simultaneous builds so this doesn't seem to work for this usecase.
I can image that one way to solve this would probably be to write all my parameters to a file, upload this as a pipeline artifact and then write variables from this imported artifact in the release stage. I want to avoid this if possible since it feels like a very clunky workaround.