Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Latest commit

 

History

History
57 lines (41 loc) · 1.46 KB

wrappers.md

File metadata and controls

57 lines (41 loc) · 1.46 KB

wrappers

This part of the library contains utilites for wrappers such as

  • ansiColor

Table of contents

color(Map config, Closure body)

This step is just a small adapter for the ansiColor step. It uses the pipeline configuration to set the color mode

color Example

import io.wcm.devops.jenkins.pipeline.utils.logging.LogLevel
import io.wcm.devops.jenkins.pipeline.utils.logging.Logger

import static io.wcm.devops.jenkins.pipeline.utils.ConfigConstants.*
Map config = [
    (ANSI_COLOR) : ANSI_COLOR_XTERM
]

Logger.init(this, LogLevel.INFO)
Logger log = new Logger(this)
wrappers.color(config) {
    log.info("i have a colorized loglevel!")
}

Configuration options

The step has only one configuration option: ConfigConstants.ANSI_COLOR. The value used in this configuration option is the color mode provided to the ansiColor Step

import static io.wcm.devops.jenkins.pipeline.utils.ConfigConstants.*

wrappers.color(
        (ANSI_COLOR): ANSI_COLOR_XTERM
    )

Available values:

  • ConfigConstants.ANSI_COLOR_XTERM
  • ConfigConstants.ANSI_COLOR_GNOME_TERMINAL
  • ConfigConstants.ANSI_COLOR_VGA
  • ConfigConstants.ANSI_COLOR_CSS

Related classes: