jenkins dsl doesn't create conditional build step correctly?

562 views
Skip to first unread message

Christian Posta

unread,
Jun 18, 2015, 4:39:38 PM6/18/15
to job-dsl...@googlegroups.com
Hey, so I have a conditional build step added in my Jenkins Job DSL:



But when it gets run on the jenkins server, it produces this in the config.xml (and the post build step doesn't show up in the UI:)

        <org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder>

            <condition class='org.jenkins_ci.plugins.run_condition.core.StatusCondition'>

                <worstResult>

                    <ordinal>2</ordinal>

                </worstResult>

                <bestResult>

                    <ordinal>2</ordinal>

                </bestResult>

            </condition>

            <runner class='null'></runner>

            <buildStep class='hudson.tasks.Shell'>

                <command>git branch -D test-cheese-1.0.$BUILD_NUMBER</command>

            </buildStep>

        </org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder>



I have the conditional buildstep (1.3.3) installed. 


Note, the runner class is null, and the actual plugin attribute is not part of some of the nodes


compared to a working version (created by the UI, the config.xml looks like this:)


    <org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder plugin="conditiona...@1.3.3">

      <condition class="org.jenkins_ci.plugins.run_condition.core.StatusCondition" plugin="run-condition@1.0">

        <worstResult>

          <name>FAILURE</name>

          <ordinal>2</ordinal>

          <color>RED</color>

          <completeBuild>true</completeBuild>

        </worstResult>

        <bestResult>

          <name>FAILURE</name>

          <ordinal>2</ordinal>

          <color>RED</color>

          <completeBuild>true</completeBuild>

        </bestResult>

      </condition>

      <buildStep class="hudson.tasks.Shell">

        <command>git branch -D quickstart-fuse-rest-$MAJOR_VERSION_NUMBER.$BUILD_NUMBER</command>

      </buildStep>

      <runner class="org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail" plugin="run-condition@1.0"/>

    </org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder>

Christian Posta

unread,
Jun 18, 2015, 7:55:58 PM6/18/15
to job-dsl...@googlegroups.com
Arg... so i figured it out.. 
my DSL didn't have the "runner("Fail")" line.... adding that fixes things. Sorry for the noise!


On Thursday, June 18, 2015 at 1:39:38 PM UTC-7, Christian Posta wrote:
Hey, so I have a conditional build step added in my Jenkins Job DSL:



But when it gets run on the jenkins server, it produces this in the config.xml (and the post build step doesn't show up in the UI:)

        <org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder>

            <condition class='org.jenkins_ci.plugins.run_condition.core.StatusCondition'>

                <worstResult>

                    <ordinal>2</ordinal>

                </worstResult>

                <bestResult>

                    <ordinal>2</ordinal>

                </bestResult>

            </condition>

            <runner class='null'></runner>

            <buildStep class='hudson.tasks.Shell'>

                <command>git branch -D test-cheese-1.0.$BUILD_NUMBER</command>

            </buildStep>

        </org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder>



I have the conditional buildstep (1.3.3) installed. 


Note, the runner class is null, and the actual plugin attribute is not part of some of the nodes


compared to a working version (created by the UI, the config.xml looks like this:)


    <org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder plugin="conditional-buildstep@1.3.3">

Reply all
Reply to author
Forward
0 new messages