I am having trouble defining agents for my build pipeline. I need to use 2
docker images as agents for entire pipe. first 4 steps uses one image and
last two steps uses another one. I don't want to repeat agent statement in
every stage.
It was easy with scripted pipe. I defined all my images on top level and
then for each stage I just need to say container("${name of the image}")
containers: [
containerTemplate(name: 'maven', image: 'maven:3.5.4-jdk-10',
ttyEnabled: true, command: 'cat'),
containerTemplate(name: 'docker', image: 'docker:18.03.1-ce',
ttyEnabled: true, command: 'cat'),
]
I see that declarative pipeline you can not define multiple agents at
pipeline level.
Is there a way I can define agent in one stage and in all other stages i
refer them by label/name etc?
ps - I don't want to do any setting under 'Manage Jenkins'.
Thanks
--
You received this message because you are subscribed to the Google Groups
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/5d9091ac-9744-4a74-a5a7-bda0f6c44ff6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.