I'm relatively new to Jenkins
and was wondering if there are any examples on suppressing scripted pipelines output in Jenkins
.
I see this issue on jenkins
website, but I'm not exactly sure how to implement.
I also didn't see a clear answer from a question on Stack Overflow
about this issue.
I basically want to get rid of all the Pipeline
stuff:
$ docker top 5f4682c000c81cbede8dc72f190b25254e049e9607ba008cbad72a78adab56a2 -eo pid,comm
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Check Style)
[Pipeline] ansiColor
[Pipeline] {
[Pipeline] sh
[ppetry_corpsite_apache_user-HHEF3S7EJLFY7ER74K63UO3KKEOJY46P57XF77IGT3LQ76I2UIJQ] Running shell script
+ lintcheck.sh
--------LINT RESULTS--------
********ALL TESTS PASSED*******
[Pipeline] }
[Pipeline] // ansiColor
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Check Syntax)
[Pipeline] ansiColor
[Pipeline] {
[Pipeline] sh
[ppetry_corpsite_apache_user-HHEF3S7EJLFY7ER74K63UO3KKEOJY46P57XF77IGT3LQ76I2UIJQ] Running shell script
+ syntaxcheck.sh
--------SYNTAX RESULTS--------
********ALL TESTS PASSED*******
[Pipeline] }
[Pipeline] // ansiColor
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Generate Puppet Auth Token)
[Pipeline] withCredentials
[Pipeline] {
[Pipeline] ansiColor
[Pipeline] {
[Pipeline] sh
[ppetry_corpsite_apache_user-HHEF3S7EJLFY7ER74K63UO3KKEOJY46P57XF77IGT3LQ76I2UIJQ] Running shell script
+ gentoken.sh
--------GENERATING PUPPET ACCESS TOKEN--------
Token generated successfully.
[Pipeline] }
[Pipeline] // ansiColor
[Pipeline] }
[Pipeline] // withCredentials
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
$ docker stop --time=1 5f4682c000c81cbede8dc72f190b25254e049e9607ba008cbad72a78adab56a2
$ docker rm -f 5f4682c000c81cbede8dc72f190b25254e049e9607ba008cbad72a78adab56a2
[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
GitHub has been notified of this commit’s build result
Finished: SUCCESS
You can type set +x before any command to temporary override that behavior. Of course you will need set -x to start showing them again.
What is the Scripted Pipeline in Jenkins? A Jenkins Scripted Pipeline is a sequence of stages to perform CI/CD-related tasks that can be specified as code, enabling you to develop a pipeline script and add it to your code repository so you can version it.
Alternatively you can call error(String message) step to stop the pipeline and set its status to FAILED . For example, if your stage 1 calls error(msg) step like: stage("Stage 1") { steps { script { error "This pipeline stops here!" } } }
Prerequisites:
Go to Manage Jenkins
> Configure System
> Theme
. In Extra CSS
field put the following
.pipeline-annotated {
display: none;
}
Click save.
After that you will not see any [Pipeline] logs anymore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With