Skip to content

Commit

Permalink
ref(15): Start testing wild integration with Jenkins
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanjerome committed Aug 18, 2023
1 parent e27ff46 commit bd435bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion vars/logger.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void logger(level, message) {
def LOG_LEVEL = 'INFO'

// Global log colorization enabled flag
def LOGGER_COLORIZED_ENABLED = false
def LOGGER_COLORIZED_ENABLED = ansicolor(xterm)

if (LOG_LEVELS.indexOf(level) <= LOG_LEVELS.indexOf(LOG_LEVEL)) {
def color = COLORS[level]
Expand Down
12 changes: 12 additions & 0 deletions vars/wildPipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def call() {
"wild_path=./wild-workdir",
"log_path=${env.workspace}/log",
"current_git_branch=${env.branch_name}",
LOGGER_COLORIZED_ENABLED=isXtermColorActivated(),
]

podTemplate(
Expand Down Expand Up @@ -53,4 +54,15 @@ def call() {
}
}
}
}

private int isXtermColorActivated() {
try {
ansiColor('xterm') {
return 0
}
}
catch (Throwable ex) {
return 1
}
}

0 comments on commit bd435bb

Please sign in to comment.