2

I'm facing this challenge in my current Jenkins setup. Where the set of cases like Shell(bash) script executed remotely:

  1. Permission denied while my installer copied
  2. Unable to connect with SSH

Any suggestion on these cases how can I fix it? any pointers?

Thanks in advance

PavanDevarakonda
  • 625
  • 5
  • 27
  • 1
    You must exit your bash script with exit 1. See answer: https://stackoverflow.com/questions/20845381/do-manual-build-fail-in-jenkins-using-shell-script – Kraego May 09 '19 at 10:10

1 Answers1

1

A pipeline will fail if a script / software returns a value not equal zero. There are programs like Robocopy that execute a command, fail and return a 0. Jenkins does not understand that the program was not successful and marks the pipeline as a success.

Basically this is what you have to do. If your script returns a value not equal zero the pipeline will fail.

Michael Kemmerzell
  • 4,802
  • 4
  • 27
  • 43