Reputation: 442
I want to write a script for Jenkins which will change the status color of the jenkins from blue to green once the job is successful.
I am not much aware of the shell scripting, Can someone guide me on how and where should I start from?
Or is there any way I can provide a message as I have attached the screenshot.. The message for testing can be anything like "pipeline is passed"
Upvotes: 0
Views: 2713
Reputation: 11
This plugin may be one of solutions: https://www.jenkins.io/doc/pipeline/steps/badge/ A lot of options to add badges, text to Build History
Pipeline script for this specific result in scripted pipeline
node('master') {
stage('test') {
addShortText('pipeline has passed')
}
}
Note: Same results can be achieved in declarative pipeline for code generation go to yourJenkinsAddress/pipeline-syntax/ and select addShortText, addBadge or any other method from this plugin in Sample Step:
Pipeline-syntax generation example
Upvotes: 1
Reputation: 1242
To change color from blue to green just install green balls plugin))
Upvotes: 0
Reputation: 79
The default color for successful job is blue (Meant pipeline is successful). I don't think you can add another message or color. You can try customize the the build name with the Build Name Setter.
Jenkins also have another status - unstable which means non-failed errors.
Upvotes: 0