Status: Resolved (View Workflow)
I have matrix builds which run on several nodes, and if a "deploy" checkbox param was selected when the build ran we call a deploy job to push the code out for testing. Unfortunately, using a conditional build step for this causes the deploy to happen for every build node. It should only be run once in our case, after all builds succeed.
If I could use a conditional build step as a post-build action, this would work perfectly!
I did try that, but it has two problems: one, it doesn't work in matrix builds (not currently supported), which is where I need this. And two, it says it doesn't support the Parameterized Trigger plugin (due to
JENKINS-12418), which I also need. But I would be running that plugin through Conditional Build Step, so maybe it would work? Flexible Publish -> Conditional Build Step -> Parameterized Trigger... Bluh. Something about chaining all these plugins makes me nervous
owenmehegan: where you able to successfully chain plugins (Flexible Publish -> Conditional Build Step -> Parameterized Trigger)? I was not able to choose "Conditional Build Step" as an action for "Flexible Publish".
Maybe you were able to workaround it in some other way?
emszpak: No, I ended up using the PostBuildScript plugin (https://wiki.jenkins-ci.org/display/JENKINS/PostBuildScript+Plugin) to trigger Conditional Build Step in a post-build action. It's really ugly, I wish Conditional Build Step worked in post-build natively. But this works.
assigning this to the flexible publish plugin, as this is the equivalent to the conditional-buildstep-plugin for post build actions. This is and was always the target of the felxible-publish plugin - the author of these two plugins (bap and me) defined it that way.
If it does not yet what you are looking for, then the plugin might have to be extended/fixed.
|Field||Original Value||New Value|
|Component/s||flexible-publish [ 16130 ]|
|Component/s||conditional-buildstep [ 15947 ]|
|Assignee||domi [ domi ]||bap [ bap ]|
OK. Flexible Publish doesn't help me at the moment because it doesn't support matrix builds, and it doesn't support the Parameterized Trigger plugin. These issues are both mentioned on the Flexible Publish wiki page, though the bug around using it with Parameterized Trigger (
JENKINS-12418) is marked as fixed now.
cjo fixed issue 12418 by adding run conditions to the parameterized trigger. This means that you should be able to add the parameterized trigger step directly (without Flexible Publish) and selecting the run condition within the Parameterized Trigger step
What happened to the flexible publish plugin? I can't find it in the plugin manager anymore, though the wiki page is still there. It looks like installations abruptly stopped in March. Did it get replaced with something?
And I can't see anything in the current version of parameterized trigger that gets me what I want.
To go back to the original bug request: I want to be able to use conditional build steps in a post-build action. Specifically, I want to be able to say:
if $some_build_param = "true"
trigger a downstream build with parameters
I need this as a post-build action, in matrix builds.
if $some_build_param = "true" trigger a downstream build with parameters end
– Shouldn't this be doable with the ParamTriggerPlugin? You can have the parameters for the downstream job loaded from a properties file, and you can use this file as "condition", with teh checkbox that doesn't trigger if the file's missing.
Interesting, that might work for us. I'll experiment with it. I still would prefer to be able to do actual conditional logic, using the Conditional Build Step plugin, in post-build steps. On matrix builds.
The problem with triggering only if a properties file exists is, in a matrix job I have to copy the file from the slave to the master before I can trigger on it. Just an annoying extra post-build step in every job.
|Assignee||bap [ bap ]||ikedam [ ikedam ]|
Now Flexible Publish plugin 0.11 supports build triggers and multi-configuration projects.
Please try it!
|Resolution||Fixed [ 1 ]|
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Workflow||JNJira [ 145111 ]||JNJira + In-Review [ 191360 ]|
have a look at this plugin: https://wiki.jenkins-ci.org/display/JENKINS/Flexible+Publish+Plugin
is this what you want?