Hello,
is it possible at all? I have tried to use Conditional BuildStep with condition "Always" but without success. I have two build step each of them is shell script.
Build step1 - Execute shell
#!/bin/bash -ex
echo "******* STEP1 *******"
exit 1
Build step2 - Execute shell
#!/bin/bash -ex
echo "******* STEP2 *******"
exit 0
Conditional step (single)
Run?: Always
Builder: Execute shell
#!/bin/bash
echo "%%%%%%% CLEAN %%%%%%%"
With such settings I get the following result
Started by user Alex
[EnvInject] - Loading node environment variables.
Building on master in workspace /usr/share/tomcat8/.jenkins/workspace/temp
Run condition [Always] enabling prebuild for step [Execute shell]
[temp] $ /bin/bash -ex /var/cache/tomcat8/temp/hudson8076614436373471043.sh
+ echo '******* STEP1 *******'
******* STEP1 *******
+ exit 1
Build step 'Execute shell' marked build as failure
Finished: FAILURE
P.S.
Jenkins ver. 1.652