Dynamically Set Machine Image Value

Our organization encompasses several projects, each of which have a hardcoded value for build_image: machine: image: (ex. ‘ubuntu-2204:current’).

How can we define a value in a central location and read from it for this machine:image value? Is this a use case for Contexts, Custom Orbs, Dynamic Configuration, or something else entirely? Please include reasoning behind the correct answer as well.

Have you used the continuation orb in any of your configurations?

The reason for asking is that this is a possible solution for defining a business level script that can be added to each project and in the future updated without having to modify the main workflow file.

Within this newly created master config file you can define (or retrieve from other systems) values that can be passed onto the project config file so that they are defined as pipeline.parameters. Each project would have to be updated to accept these parameters, but nothing more.

Getting the values defined as pipeline.parameters rather than environment variables allows them to be used as values that must be known at the time the config file is processed by the pre-processor.

This type of configuration removes the need to change each project so that it can be started via API calls or via the manual option within the web GUI. Both of which also allows pipeline.parameter values to be set.

As for where to store the exact value for the image to be used, you could place it at the project level environment variable or use an organization level context. Project level would require additional work during each upgrade, but if you have many projects you may not want to force them to all upgrade at once.