I'm working with jenkins pipeline and have a shared global library. I created several functions that users can use, however the main problem I'm facing is having better output in the Console Output and Blue Ocean: Is there a way to create in groovy a named block (such as when calling the sh function all the output is contained inside)? I tried playing around with stages like so:
stage('Checkout') {
checkout scm
stage('Some Custom Step') {
// Some custom step logic
}
}
However this approach didn't work. I know you can create custom steps by writing plugins for Jenkins and then calling the function in your groovy script, I was just wandering if there is a way to write such a thing directly in groovy, say, in my library.
Also is there a way to silence output?
sh '<some command with meaningful output>'
sh '<some random output not relevant to the user>' //
Silence somehow
echo 'step finished successfuly!'
Thanks for everyone in advance