Skip to content

jjdevbiz/jenkins-ansicolor-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jenkins ANSI Color Plugin

Build Status

This plugin adds support for standard ANSI escape sequences, including color, to Console Output.

This plugin is available here and has a page on the Jenkins Wiki.

Install

install

Enable

enable

Color!

color

Customize

color

Misc

Does it Even Work?

Create a job in Jenkins that executes the following shell script. Don't forget to check the "Color the ANSI Console Output" option.

#!/bin/bash
echo -e "\e[31mHello World\e[0m"
echo -e "Normal \e[1mBold\e[0m"
echo -e "Normal \e[4mUnderlined\e[0m"

color

Check out this guide for more examples.

Supported ANSI Color Codes

Only the standard ANSI Color Codes are supported for both foreground and background colors. "High Intensity" colors in the 90-109 range are non-standard are not supported. The colorize ruby library, for example, emits high intensity codes when using the "light" color options.

See issue #16 for a sample of non-standard output.

Colorizing Ruby RSpec Output

RSpec formatters detect whether RSpec is running in a terminal or not, therefore suppressing color output under Jenkins. Specify --colour in your .rspec file or options, along with the following setup in spec_helper.rb.

RSpec.configure do |config|
 config.tty = true
end

License

The ANSI Color Plugin is licensed under the MIT License.

It uses JANSI (Apache 2.0 License).

Contributing

  • Fork the project on Github
  • Make your feature addition or bug fix, write tests, commit.
  • Send me a pull request. Bonus points for topic branches.