Hi,
I'm currently using a Jenkins declarative pipeline (note: if my issue would be solved with a scripted pipeline, I can switch).
The builds run inside an ephemeral docker agent spinned up by the pipeline using a syntax similar to
agent{ docker{ image "my-image"}}}
The issue with that is that I'm going to have a big number of pipelines defined as Jenkinsfiles which are all kind of similar
to each other, and all of them will be running using the same docker agent.
As such, I'd love to be able to parameterise the image name by defining it as a variable or as a function inside a jenkins
library, so that if the image needs to be change I don't have to commit back to all of the existing Jenkinsfile.
I saw it's possible to define the whole declarative pipeline inside a function, but there seems to be no option to set instead
just some String variable to be used when setting up the agent, and no possibility to define anything to run outside of the
normal pipeline steps - is that correct?