Jenkins 2.x (DSL) - can ansi color be used used?

613 views
Skip to first unread message

thomas....@teamaol.com

unread,
Apr 11, 2016, 10:14:45 AM4/11/16
to Jenkins Users
Hi,

relating Jenkins 2.x and DSL ...
You can do a wrap([$class: 'TimestamperBuildWrapper']) { ... } for getting timestamps.
Is there also a way to get the ansi color plugin enabled?

Kind Regards,
Thomas

thomas....@teamaol.com

unread,
Apr 11, 2016, 10:34:30 AM4/11/16
to Jenkins Users
I found it after some Google searches: https://github.com/dblock/jenkins-ansicolor-plugin

$ cat cicd/Jenkinsfile 
#!groovy
node {
    wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm', 'defaultFg': 1, 'defaultBg': 2]) {
        // This is the current syntax for invoking a build wrapper, naming the class.
        wrap([$class: 'TimestamperBuildWrapper']) {

Reply all
Reply to author
Forward
0 new messages