Closed mahmoudimus closed 10 years ago
<org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder plugin="conditional-buildstep@1.3.3">
<condition class="org.jenkins_ci.plugins.run_condition.core.BooleanCondition" plugin="run-condition@1.0">
<token>${ENV,var="HAS_GIT_TAG"}</token>
</condition>
<buildStep class="hudson.plugins.parameterizedtrigger.TriggerBuilder" plugin="parameterized-trigger@2.22">
<configs>
<hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
<configs>
<hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
<properties>PP_BUILD=${GIT_COMMIT}
PP_BRANCH=${GIT_BRANCH}
GIT_TAG=${GIT_TAG}
HAS_GIT_TAG=${HAS_GIT_TAG}</properties>
</hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
</configs>
<projects>rump-quality</projects>
<condition>ALWAYS</condition>
<triggerWithNoParameters>false</triggerWithNoParameters>
<block>
<unstableThreshold>
<name>UNSTABLE</name>
<ordinal>1</ordinal>
<color>YELLOW</color>
<completeBuild>true</completeBuild>
</unstableThreshold>
</block>
<buildAllNodesWithLabel>false</buildAllNodesWithLabel>
</hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
</configs>
</buildStep>
<runner class="org.jenkins_ci.plugins.run_condition.BuildStepRunner$DontRun" plugin="run-condition@1.0"/>
</org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder>
ping @coderanger need your help integrating this into balanced-ci
Initial attempt:
job 'test' do |new_resource|
conditionally_continue do
condition :boolean do
token '${ENV, var="HAS_GIT_TAG"}'
on :true do
trigger 'rump-quality' do
blocking true
parameters do
predefined true
properties <<-EOF
PP_BUILD=${GIT_COMMIT}
PP_BRANCH=${GIT_BRANCH}
GIT_TAG=${GIT_TAG}
HAS_GIT_TAG=${HAS_GIT_TAG}
EOF
end
end
end
on :false do
stop
end
end
end
end
@mjallday has told me that i'm going about this all wrong, instead of focusing on a DSL, we should focus on template re-usability.
Given this mindset, I'm going to re-approach this problem.
ping @coderanger - ready to merge this.
@mahmoudimus now that you've completed this change, do you still hold the same opinion that you had to do too much DSL specific work?
Attempt to build a job on git commit. Chain all subsequents on a git tag using parameterized build plugin.