downstreamParameterized Trigger working Different under Conditional Step

1,078 views
Skip to first unread message

terryw...@gmail.com

unread,
Mar 6, 2017, 7:16:13 PM3/6/17
to job-dsl-plugin
I have a Jenkins job that needs to have a Post-build Action of "Flexible publish" with a "Boolean condition" and the "Action" needs to be "Trigger parameterized build on other projects" with a "Trigger when build is" "Stable". Here is the dsl of what I need:
publishers {
    downstreamParameterized {
        trigger('My_Job') {
            parameters {
                currentBuild()
                sameNode()
            }
        }
    }
}

Problem is if I put this inside a step to get the boolean condition, it totally changes the outcome:
publishers {
    flexiblePublish {
        conditionalAction {
            condition {
                booleanCondition('${RunDownstream}')
            }
            steps {
                downstreamParameterized {
                    trigger('My_Job') {
                        parameters {
                            currentBuild()
                            sameNode()
                        }
                    }
                }
            }
        }
    }
}

What I get when it is in a step is "Trigger/call builds on other projects" instead of "Trigger parameterized build on other projects" without a trigger condition.

Has anyone else ran in to this? Is there a way to change this?  Help!  :)

                       

Daniel Spilker

unread,
Mar 7, 2017, 2:45:35 AM3/7/17
to job-dsl...@googlegroups.com
The Parameterized Trigger Plugin provides a build step and a publisher. They are a bit different, but the DSL syntax is mostly the same. In your first example you are using the publisher and in the second example you are using the build step. The Flexible Publisher plugin supports steps and publishers, so just replace steps by publishers.

Daniel

--
You received this message because you are subscribed to the Google Groups "job-dsl-plugin" group.
To unsubscribe from this group and stop receiving emails from it, send an email to job-dsl-plugin+unsubscribe@googlegroups.com.
To post to this group, send email to job-dsl-plugin@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/job-dsl-plugin/0487ff0b-47f4-44ca-8756-6f5c5c3730f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

terryw...@gmail.com

unread,
Mar 7, 2017, 10:41:21 AM3/7/17
to job-dsl-plugin
Thank you Daniel!!!  That worked great!


Reply all
Reply to author
Forward
0 new messages