mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-11-28 08:49:44 +02:00
fix(cpe): add more null checks (#2913)
This commit is contained in:
parent
ff507b959e
commit
a03be973bc
@ -6,8 +6,8 @@ import groovy.transform.Field
|
||||
|
||||
void call(Map parameters = [:]) {
|
||||
final script = checkScript(this, parameters) ?: this
|
||||
String piperGoPath = parameters.piperGoPath ?: './piper'
|
||||
String piperGoPath = parameters?.piperGoPath ?: './piper'
|
||||
def output = script.sh(returnStdout: true, script: "${piperGoPath} readPipelineEnv")
|
||||
Map cpeMap = script.readJSON(text: output)
|
||||
script.commonPipelineEnvironment.setCPEMap(script, cpeMap)
|
||||
script?.commonPipelineEnvironment?.setCPEMap(script, cpeMap)
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ import groovy.transform.Field
|
||||
|
||||
void call(Map parameters = [:]) {
|
||||
final script = checkScript(this, parameters) ?: this
|
||||
String piperGoPath = parameters.piperGoPath ?: './piper'
|
||||
Map cpe = script.commonPipelineEnvironment.getCPEMap(script)
|
||||
String piperGoPath = parameters?.piperGoPath ?: './piper'
|
||||
Map cpe = script?.commonPipelineEnvironment?.getCPEMap(script)
|
||||
if (cpe == null) {
|
||||
return
|
||||
}
|
||||
@ -18,4 +18,7 @@ EOF
|
||||
"""
|
||||
|
||||
def output = script.sh(returnStdout: true, script: writePipelineEnvCommand)
|
||||
if (parameters?.verbose) {
|
||||
script.echo("wrote commonPipelineEnvironment: ${output}")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user