1

I have 30+ jobs in jenkins that deploy code. For any release, it could be 1 to 30 of those jobs that need to be run. Each job is standalone and deploys its piece independently. For simplicity let's say I have only 5 jobs...

  • job A
  • job B
  • job C
  • job D
  • job E

As an example, for one release I need to deploy A, B, C and the next one maybe I need to deploy A and E. I was hoping I could make one job that has all 30 deploy jobs as checkboxes (booleans), then I can just run that job, choose the others to run, and go.

Each job accesses git with a branch parameter, but for a release, the branch is always the same for all projects so I figure I can set the branch in the main job and pass the parameter to each deploy job.

Any ideas of the best way to get this to work?

3
  • I don't understand the thing with the branches very well, could you explain it in a different way please? Sep 21 '21 at 14:40
  • It's just a parameter that will be the same for all jobs. You can ignore that part if it bothers you
    – Brian Pipa
    Sep 21 '21 at 14:55
  • Maybe you can use the parameterized parameters option from Jenkins: baeldung.com/ops/jenkins-parameterized-builds . I'm not 100% convinced about it, because you still would have to configure the 30 parameters for each job, but at least from this job you could also call the others. Sep 21 '21 at 16:13
0

I would use a checkboxParam that has the job names values. Then I would iterate over this param and trigger jobs with it from same groovy file. If you need to get the branch name you can use a git param for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.