build-monitor-plugin icon indicating copy to clipboard operation
build-monitor-plugin copied to clipboard

Customize build monitor text

Open getaaron opened this issue 7 years ago • 9 comments

I would like the ability to customize the build monitor text dynamically from a Jenkinsfile. e.g.…

pipeline {
  stages {
    stage('Run Analysis') {
      steps {
        // do some stuff
        // the text I want to display in Build Monitor is now in output.txt
      }
    }
    stage('Update Build Monitor') {
      steps {
        // ???
      }
    }
  }
}

I couldn't find any way to do this in the docs. Is this possible currently? If not, I would like to submit it as a feature request.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

getaaron avatar Jul 06 '17 17:07 getaaron

Hi there! Could you please elaborate a bit more on what you mean by "build monitor text"?

jan-molak avatar Jul 07 '17 11:07 jan-molak

@jan-molak I mean the title and subtitle strings that appear on the build monitor view:

image

In my case, I want to regularly, automatically run some customer satisfaction analytics and show something like this (photoshopped):

image

This could be helpful for communicating lots of different data (e.g. test suite run time, file size of build artifacts, etc.)

getaaron avatar Jul 10 '17 17:07 getaaron

What you can do today is:

  1. Use a display name for the job, which will replace "QA >> my-repo" with a static name, for example "Customer satisfaction"
  2. Set the build description after the execution with a desired statement, or use postbuild badges
  3. Disable committers for that job

ChadiEM avatar Jul 26 '17 06:07 ChadiEM

Thanks, I guess it would be helpful if I could do more than currentBuild.setDisplayName and currentBuild.setDisplayName and currentBuild.setDescription.

getaaron avatar Aug 18 '17 19:08 getaaron

@getaaron build description supports simple HTML, so you can format text (bold, color) and add a table, see screenshot: image

vanta avatar Sep 15 '17 08:09 vanta

@vanta , Can you shortly guide me how to construct the dashboard as yours above? Where exactly is the space for build description, so we can add text colors and tables? Thanks in advance for your help.

t-tomaszewicz avatar Oct 03 '17 12:10 t-tomaszewicz

See my comment below

vanta avatar Oct 03 '17 14:10 vanta

For every build you can set a description programmatically. By default it contains a date of build I believe. Just put a HTML there, e.g.: currentBuild.description='line1<br/>HTML test<br/>line2'

vanta avatar Oct 03 '17 16:10 vanta

@jan-molak @vanta : Is it possible to add the description for the jobs using the Build Monitor Plugin ?

Ajaykps avatar Jul 31 '18 08:07 Ajaykps