Conditional Post-Build step in Jenkins (Ideally without plugins)
It is posssible but it is a bit messy and can not be done with ui only.
Create the the conditional build step in the build block and save the konfiguration. Edit the xml file and move the whole conditional build step it to the post build block. Reload the jenkins configuration and it works like intended.
You can make any Build step execute as Post-build step.
- Install Flexible Publish plugin
- Install Any Build Step plugin
- Under Configure System, look for "Flexible publish", and choose
Any build step
from drop-down.
The configure Job.
- In your Job configuration, add Post-build action called "Flexible Publish".
- Select condition.
- Select action.