Jenkins follows the shell assembly steps using /bin/sh -xe by default. -x means printing every command executed. -e means exit with an error if any of the commands in the script failed.
So, I think in your case it was that you ended the git command with 1, and because of the -e option, the default shell gets an exit code other than 0, ignores the rest of the script and marks this step as a failure. We can confirm this if you can post your build step script here.
In this case, you can try setting #!/bin/sh so that the script runs without an option; or do set +e or something similar at the top of the build step to override this behavior.
Edited: Another thing to note is that if the
last command in your shell script
returns a non-0 code , the entire build step will still be marked as a failure even with this installation. In this case, you can simply put the
echo command at the end to avoid this.
Another related question
Xiawei Zhang Feb 11 '15 at 7:00 2015-02-11 07:00
source share