Can I build based on the results of the SSH task?

I was wondering if I can use the SSH bamboo task to run the script (this launches a small java message injector).

Then grep logs for ERRORS. If any ERROR is present, I would like to complete the assembly.

Something like that:

enter image description here

+5
source share
1 answer

Is this a Bash question or is it really about Bamboo? Here is the answer to a Bash question:

If you run

[[ ! $(grep ERROR /a/directory/log/*) ]] 

The script will fail if it finds the word "ERROR" anywhere in the files.

Bamboo should detect the completion of the task as failed.

(Note that if Bash is not the default shell on your target system, you may need #!/bin/bash on top of the script file.)

+5
source

Source: https://habr.com/ru/post/1201247/


All Articles