Further refinements
This commit is contained in:
parent
f6d2012fbb
commit
ddc5b9a6d0
@ -12,7 +12,7 @@ void call(Map config = [:], Closure body = { }) {
|
||||
]
|
||||
Map runConfig = defaults + config
|
||||
stage(runConfig.stepName) {
|
||||
printBanner(runConfig.stepName)
|
||||
printBanner(runConfig.stepName, [ boxStyle : 'plain' ])
|
||||
if (runConfig.artifacts.size() < 1) {
|
||||
assert runConfig.artifacts : 'Error: No named artifacts to package!'
|
||||
}
|
||||
|
||||
@ -1,4 +1,12 @@
|
||||
void call(String stepName, String boxColor = 'green', String textColor = 'white', String styleName = 'default') {
|
||||
void call(String stepName, Map styleMap = [:]) {
|
||||
Map defaultStyleMap = [
|
||||
boxColor: 'green',
|
||||
textColor: 'white',
|
||||
boxStyle: 'default'
|
||||
]
|
||||
|
||||
runStyleMap = defaultStyleMap + styleMap
|
||||
|
||||
Map colors = [
|
||||
black: '\u001b[30m',
|
||||
red: '\u001b[31m',
|
||||
@ -30,7 +38,10 @@ void call(String stepName, String boxColor = 'green', String textColor = 'white'
|
||||
]
|
||||
]
|
||||
|
||||
Map style = boxStyles[styleName]
|
||||
String textColor = runStyleMap['textColor']
|
||||
String boxColor = runStyleMap['boxColor']
|
||||
|
||||
Map style = boxStyles[runStyleMap['boxStyle']]
|
||||
|
||||
stepBanner = style['sd'] + " ${colors[textColor]}$stepName${colors['reset']}${colors[boxColor]} " + style['sd']
|
||||
bannerWidth = stepName.length() + 6
|
||||
|
||||
Loading…
Reference in New Issue
Block a user