Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress Scripted Pipelines Output in Jenkins

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
like image 281
Kris Reese Avatar asked Jun 29 '18 22:06

Kris Reese


People also ask

How do I hide console output in Jenkins?

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 are Scripted pipelines in Jenkins?

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.

How do you stop a stage in Jenkins pipeline?

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!" } } }


1 Answers

Prerequisites:

  • Pipeline: Job plugin version 2.18 or above
  • Simple Theme plugin

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.

like image 73
Vitalii Vitrenko Avatar answered Oct 11 '22 18:10

Vitalii Vitrenko