Hello, 

I am using job_dsl plugin to create jobs in a loop. We have several 'sets' 
of code all of which will need an identical set of jobs. This is working 
fine for things using the built in helpers but we also have a need to use 
some plugins not directly supported. I have created configure blocks which 
enable the plugins but variable substitution is not working within the 
configure blocks. The last value of the loop is used in all cases. Ex; 

def FeatureSets = ['DSL1','DSL2'] 

for (i in FeatureSets) 
{ 
   y=FeatureSets.indexOf(i) 
   println "y=$y" 
   job { 
      name "DSL_TEST_${i}" 

      configure { project -> 
         SideBarLinksNode = 
project/'properties'/'hudson.plugins.sidebar__link.ProjectLinks' 
        
 SideBarLinksNode/links/'hudson.plugins.sidebar__link.LinkAction'/url << 
"${i}/index.html" 
        
 SideBarLinksNode/links/'hudson.plugins.sidebar__link.LinkAction'/text << 
"${i} Doxygen HTML" 
        
 SideBarLinksNode/links/'hudson.plugins.sidebar__link.LinkAction'/icon << 
"document.gif" 
      } 
   } 
} 

This generates two jobs named DSL_TEST_DSL1 and DSL_TEST_DSL2 as intended. 
It also adds the sidebar links plugin but the content of the links is the 
same in both jobs and is DSL2 twice instead of DSL1 in job 1 and DSL2 in 
job 2. 

Any help would be greatly appreciated! 

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].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to