Pipeline job triggers another job twice

47 views
Skip to first unread message

Venkata Burra

unread,
Jun 29, 2017, 3:13:07 PM6/29/17
to Jenkins Users

Hi,

 

I have a question regarding a pipeline job.

 

I have Pipeline Job1, Pipeline Job2 and Pipeline Job3 jobs created in Jenkins. The Pipeline Job1 is coded to trigger only Pipeline Job2 depending on some condition. But the Pipeline Job1 is triggering Pipeline Job2 once and triggering Pipeline Job2 and Pipeline Job3. Please advice me how can I resolve this issue.

 

Michael Pailloncy

unread,
Jul 2, 2017, 8:57:01 AM7/2/17
to jenkins...@googlegroups.com
Not sure to fully understand. Can you share your Pipeline script please ?

--
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 jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/4a734df4-fb4a-4bae-9ca6-14e2c8c77122%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

colourmeamused

unread,
Jul 2, 2017, 3:11:09 PM7/2/17
to Jenkins Users
Echoing Michael, need more info. But maybe you can use the 'build' step instead of trigger chains?

Venkata Burra

unread,
Jul 5, 2017, 4:23:53 PM7/5/17
to Jenkins Users
Thanks for your responses, below is the pipeline code which I have and I am using build step to invoke another pipeline job. This build step should invoke "XX-Trunk-Pipeline-Test-Setup" job once but it is invoking it twice once with parameters and second time without parameters. It is also invoking "YY-Trunk-Pipeline-Test-Setup" and "ZZ-Trunk-Pipeline-Test-Setup" jobs which are not even set in the code.


node {
    

    def tests = [xxSelenium: "XX-Trunk-Pipeline-Test-Setup"]

    
    for (def entry in entrySet(tests)) {
        if("${Include_Tests}" == "true") {
            stage "${entry.key} Test Setup:"
                build job: "${entry.value}", propagate: false, wait: false, parameters: [[$class: 'StringParameterValue', name: 'xx_db_user', value: "${xx_db_user}"], [$class: 'StringParameterValue', name: 'xx_db_pass', value: "${xx_db_pass}"], [$class: 'StringParameterValue', name: 'xx_db_baseurl', value: "${xx_db_baseurl}"], [$class: 'StringParameterValue', name: 'xx_db_user', value: "${xx_db_user}"], [$class: 'StringParameterValue', name: 'xx_db_pass', value: "${xx_db_pass}"], [$class: 'StringParameterValue', name: 'xx_db_baseurl', value: "${xx_db_baseurl}"], [$class: 'StringParameterValue', name: 'base_url', value: "${base_url}"], [$class: 'StringParameterValue', name: 'xx_url', value: "${xx_url}"], [$class: 'StringParameterValue', name: 'xx_url', value: "${xx_url}"], [$class: 'BooleanParameterValue', name: 'Run_Regression', value: "${Run_Regression}".toBoolean()]]
        }
    }

}
Reply all
Reply to author
Forward
0 new messages