Conditions

Missing builderIf you're not able to add the builder of your choice within a conditional build step (because it's not available within the dropdown), then this is likely because the builder does not provide a @DataBoundConstructor constructor and/or the Descriptor does not extend hudson.tasks.BuildStepDescriptor. For non programmers: the plugin you would like to use does not yet follow the newest Jenkins coding guidelines. Without this, the conditional buildstep plugin is not able to work with it.

Conditional step (single)

This build step allows you to select any build step and define a condition to control whether the step should be executed.
For reasons why you might want to use this step, see Why use Conditional step (single)?

Conditional steps (multiple)

A 'Conditional steps (multiple)' container is able to contain any number of any other buildsteps (e.g. Shell, Ant, Maven,...) and you can have any number of 'Conditional Steps' containers, each configured with a different condition.

Hi,
I have a problem with this plugin.
I've set the configuration for my job t...

Hi,

I have a problem with this plugin.

I've set the configuration for my job to mark build as unstable if the run condition fails, but it doesn't work. If the condition fails the buildstep under the condition is not runned and the build result is success. Instead, it should mark the build as unstable. Same with "mark build as fail" option.

I have an issue when I try to add a "ArtifactoryDeployer" build step (or a nativ...

I have an issue when I try to add a "ArtifactoryDeployer" build step (or a native "Archive artifacts" build step) in a "Conditional Step (multiple)". When I save the modification, I have a java exception, see below.
There is no issue when I add this "ArtifactoryDeployer" (or the native "Archive artifacts" build step) build step in a "Conditional Step (single)" ! Any Idea ?

javax.servlet.ServletException: java.lang.RuntimeException: Failed to instantiate class org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder from {"":["15","0"],"runCondition":{"stapler-class":"org.jenkins_ci.plugins.run_condition.logic.And","conditions":[{"":"2","condition":{"stapler-class":"org.jenkins_ci.plugins.run_condition.core.BooleanCondition","token":"${ENV, var=\"GAME_MARKET_amazon\"}"}},{"":"2","condition":{"stapler-class":"org.jenkins_ci.plugins.run_condition.core.BooleanCondition","token":"${ENV, var=\"GAME_ENVIR_prod\"}"}}]},"runner":{"stapler-class":"org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail"},"conditionalbuilders":[{"command":"echo Hello","stapler-class":"hudson.tasks.BatchFile","kind":"hudson.tasks.BatchFile"},{"msBuildName":"MSBuild .Net 4.0","msBuildFile":"${WORKSPACE}/Test/Build/Test.sln","cmdLineArgs":"/p:Platform=Android /verbosity:detailed /p:Configuration=${CONFIGURATION}","buildVariablesAsProperties":false,"continueOnBuildFailure":false,"stapler-class":"hudson.plugins.msbuild.MsBuildBuilder","kind":"hudson.plugins.msbuild.MsBuildBuilder"},{"deployedArtifact":{"includes":"**/*","basedir":"","remote":"${BUILD_ID}","excludes":"","flatten":false,"failNoFilesDeploy":false,"deleteRemote":false,"deleteRemoteArtifacts":false},"deployEvenBuildFail":false,"stapler-class":"org.jenkinsci.plugins.artifactdeployer.ArtifactDeployerPublisher","kind":"org.jenkinsci.plugins.artifactdeployer.ArtifactDeployerPublisher"}],"stapler-class":"org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder","kind":"org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder"}
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:719)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:241)
at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:677)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:770)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:583)
at org.kohsuke.stapler.Stapler.service(Stapler.java:214)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
at winstone.ServletConfiguration.execute(ServletConfiguration.java:248)
at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:376)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:58)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:206)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:179)
at net.bull.javamelody.PluginMonitoringFilter.doFilter(PluginMonitoringFilter.java:86)
at org.jvnet.hudson.plugins.monitoring.HudsonMonitoringFilter.doFilter(HudsonMonitoringFilter.java:84)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98)
at hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:66)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:98)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:64)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:50)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:194)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:366)
at winstone.RequestDispatcher.forward(RequestDispatcher.java:331)
at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:227)
at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)

There are two ways: Conditional step (multiple) and Conditional step (single). A...

There are two ways: Conditional step (multiple) and Conditional step (single). As I understand, there's no difference between them except of you can't add another step if you've chosen the second variant. But it's always no sense to use this variant - Conditional step (single), because every time there's a chance that you will need to add an additional step. And Conditional step (multiple) is handy and short enough, I don't see any problems in using it even when I need only one step.

Hi folks,
Does anyone have an idea what kind of condition should I create to p...

Hi folks,

Does anyone have an idea what kind of condition should I create to perform a night build only if there was committed something to SCM during the day? In other words, I just want to perform a night build ONLY in case there was previously performed (during the day) a "Poll SCM changes" based build.

At the moment, our jobs are configured to perform "DAILY" builds based of polling SMC changes and the time scheduled "NIGHTLY" builds, which are performed regardless if there was committed something in the SCM. I would like to change that.

Is that possible with the Conditional BuildStep Plugin or should I use different plugin for this?

Maybe I'm missing something obvious, but I can't get this to work using build st...

Maybe I'm missing something obvious, but I can't get this to work using build status for the failure case. A simple example: I create a standard build step, execute shell command, return 0. Subsequent conditional build steps using the 'Always' and 'build status: success/success' run as expected, and the conditional step using 'build status: failure/failure' doesn't. However, If I change the initial build step to return 1, none of the other steps are executed, Jenkins just marks the build as failed and stops.

From further experiments, it looks like this only works as post-build actions. U...

From further experiments, it looks like this only works as post-build actions. Using any build step & flexible publish, we are able to do stuff based on the build status, just not during the actual build phase.