Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Can Jenkins & Groovy be used to loop through a list of build jobs (params for each) and launch them?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can Jenkins and Groovy be used to loop through a list of Visual Build Pro builds (with distinct params for each one) and launch the specified build jobs? Each build would require 2 different VBP scripts, one for applying a label to the source files, and the other for building the software package.

There is no need to have these builds run in parallel, having them run sequentially would be preferred, since the labeling for a given build would always precede the build's compilation.

Each build job would launch as the input file shown below was processed, with each build job being given the correct Visual Build Pro bld script name, plus the other listed parameters.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

A hypothetical input file, containing information on the desired set of Jenkins build jobs, would be:

a) Parameter list used: BLD_SCRIPT_NAME PLAT_NAME MARKET NUM_MAJOR NUM_MINOR NUM_MAINT BLD_LABEL BLD_TYPE

b) Contents of the hypothetical input file:

Labeling.bld Mercury US 14 2 0 v10000 Dev
ScriptMer.bld Mercury US 14 2 0 v10000 Dev
Labeling.bld Neptune GB 14 2 1 v10001 Rel
ScriptNep.bld Neptune GB 14 2 1 v10001 Rel
Labeling.bld Minerva AU 14 4 0 v10002 Test
ScriptMin.bld Minerva AU 14 4 0 v10002 Test
Labeling.bld Diana CN 14 4 0 v10003 Dev
ScriptChi.bld Diana CN 14 4 0 v10003 Dev


I have seen pages on the internet that discussed Jenkins/Groovy iterating, but none were applicable to the iterate for build jobs (with params for each) problem I describe above.

I would appreciate any help, please include links / Jenkins examples / Groovy code snippets if you have time.
 
author & internet detective
Posts: 40797
829
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Robert,
Welcome to CodeRanch! The Groovy plugin can do this. For example:



For the jobs where you have actual dependencies, I would recommend having an upstream/downstream dependency to force the order.
 
Jeanne Boyarsky
author & internet detective
Posts: 40797
829
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see you also posted this question on Stack Overflow. We are fine with cross-posting, however we ask you to disclose this. That way someone doesn't reproduce the effort in answering a question that has already been answered.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic