Put this as the first line in your shell scripts:

#!/bin/bash -ex

-e exits the script immediately if a command exits with a non-zero status.
-x echos the current line in the script when it's executed.

My best guess is that an error occurs in your script, which is silently 
ignored by Bash, but at the end of the script you still have a non-zero 
status.
Jenkins checks for that non-zero status and fails.


Secondly, verify your scripts with https://www.shellcheck.net/
You can use ShellCheck online, install it on your local machine, and even 
integrate it with most major editors.
Make sure that ShellCheck says "No issues detected!"


Without actually seeing the code of your shell scripts, it's at this point 
not possible to give you any further debugging tips.

Hope this helps!

-- 
Amedee
On Friday, March 5, 2021 at 6:12:03 PM UTC+1 gil.j...@gmail.com wrote:

> I have set up several jenkins jobs that do nothing more than execute bas 
> scripts, howevwe The bash scripts run fine and complete with no errors in 
> the but jenkins runs and gets errors is there a right way to debug this?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/4d10cdf6-de13-43bf-a581-76d775ff51aen%40googlegroups.com.

Reply via email to