Pipeline Jenkins using on different master

2/14/2020

I want to know how can I use different agent type in my pipeline in function of the Jenkins master executing it ?

We have two Jenkins master target :

  • One is using a kubernetes cluster for providing agent containers : agent { kubernetes { ...
  • One is using a docker agent : agent { docker ...

I am looking for a solution to make a pipeline generic which can be executed on both.

The idea is not to have stage duplications on the pipeline.

Is it possible ?

-- GeorgesM
docker
jenkins
kubernetes

0 Answers