Kris Reese
Kris Reese

Reputation: 111

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

Upvotes: 7

Views: 13794

Answers (5)

Vitalii Vitrenko
Vitalii Vitrenko

Reputation: 10395

Prerequisites:

Go to Manage Jenkins > Configure System > Theme. In Extra CSS field put the following

.pipeline-annotated {
     display: none; 
}
.pipeline-new-node {
      display: none; 
}

Click save.

After that you will not see any [Pipeline] logs anymore.

Upvotes: 17

Kent
Kent

Reputation: 439

As @Vitalii Vitrenko mentioned, solved by install the Simple Theme Plugin. But in the new version of Jenkins(2.252 in my case) maybe u need to add another new style to make it works

.pipeline-annotated {
     display: none; 
}
.pipeline-new-node {
      display: none; 
}

see: JENKINS-41845

Upvotes: 5

Jim Klimov
Jim Klimov

Reputation: 187

Thanks to all the posters for the great hint. While trying it out I came up with another nuance: I did not want to "cripple" the whole Jenkins installation for each and every job, it sufficed for me that a particular job's output be rid of the "[Pipeline] echo" garbage in the middle of an output produced by a loop with printlns.

So I used the console features of modern browsers (F12 in most of them), and edited the in-memory CSS of the already rendered page. For example with Firefox, I went to the Style Editor tab, pressed the "+" button above the listing of CSS files in use, and added a runtime patch on top of these - with an example from the other answers here.

Et voila, with "pipeline-new-node" the garbage lines disappeared and my println'ed table data remained.

Thanks again to everyone who chimed in here (and/or linked to this answer from elsewhere).

Upvotes: 0

Robson Bittencourt
Robson Bittencourt

Reputation: 127

I was able to solve the problem using the plugin mentioned in the previous answers with the following CSS:

.pipeline-new-node {
    display: none;
}

Upvotes: 6

Bela Tamas Jozsa
Bela Tamas Jozsa

Reputation: 714

The Jenkins Console Content is an HTML file / stream etc - aka you can change it's appearance with CSS and HTML styling.

The best way to do it(as it is described in the Ticket), is to use the Simple Theme Plugin.. With the help of it you can even react to some events in the DOM (Javascript, CSS).

So long story short: Install the Plugin and then override the CSS class pipeline- annotated to be hidden:

.pipeline-annotated {
    visibility: hidden;
}

In case this does not suppress all messages, you can look up other HTML elements present in the console and define similar settings for them.

Upvotes: 2

Related Questions