Hi,
from functional point of view there is no different ... but there are from 
reporting point of view ... and that's a matter of taste :-)

1. In BlueOcean view, each "sh" invocation will be displayed separately 
from the other steps and "sh" takes as parameter a name that BlueOcean will 
use to report the steps.

2. It will appears as a single step in BlueOcean and you will have to go 
into the details and look at the log output to see the result of each 
"inner" sh command

3. Assuming you wanted to say in its own "stage" and not step (because 
that's point 1), then each "sh" command will have its own "circle" on 
BlueOcean pipeline view that becomes green or red based on the outcome

4. It's exactly as point 2, but probably much easier to maintain

Cheers,
Gianluca.
 

On Tuesday, 11 August 2020 15:33:33 UTC+1, Sébastien Hinderer wrote:
>
> Dear all, 
>
> When a pipeline needs to run a sequence of several shell commands, I see 
> several ways of doing that. 
>
> 1. Several "sh" invocations. 
>
> 2. One "sh" invocation that contains all the commands. 
>
> 3. Having each "sh" invocation in its own step. 
>
> 4. Putting all the commands in a script and invoking that script through 
> the sh step. 
>
> Would someone be able to explain the pros and cons of these different 
> approaches and to advice when to use which? Or is there perhaps a 
> reference I should read? 
>
> Thanks, 
>
> Sébastien. 
>

-- 
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/c88c6e50-b84f-4acd-b627-c81612da5658o%40googlegroups.com.

Reply via email to