1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-03-27 21:49:15 +02:00

(feat) Add System Trust Token Integration to JaaS (#5257)

* add token as a pipeline  env var, comment and conditional check for env var
This commit is contained in:
maxcask 2025-02-11 12:12:10 +04:00 committed by GitHub
parent fad12860df
commit 8895891860
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View File

@ -35,6 +35,13 @@ void call(Map parameters = [:], String stepName, String metadataFile, List crede
withEnv([
"PIPER_parametersJSON=${groovy.json.JsonOutput.toJson(stepParameters)}",
"PIPER_correlationID=${env.BUILD_URL}",
/*
Additional logic "?: ''" is necessary to ensure the environment
variable is set to an empty string if the value is null
Without this, the environment variable would be set to the string "null",
causing checks for an empty token in the Go application to fail.
*/
"PIPER_systemTrustToken=${env.PIPER_systemTrustToken ?: ''}",
//ToDo: check if parameters make it into docker image on JaaS
]) {
String defaultConfigArgs = getCustomDefaultConfigsArg()

View File

@ -29,6 +29,13 @@ void call(Map parameters = [:]) {
withEnv([
"PIPER_parametersJSON=${groovy.json.JsonOutput.toJson(stepParameters)}",
"PIPER_correlationID=${env.BUILD_URL}",
/*
Additional logic "?: ''" is necessary to ensure the environment
variable is set to an empty string if the value is null
Without this, the environment variable would be set to the string "null",
causing checks for an empty token in the Go application to fail.
*/
"PIPER_systemTrustToken=${env.PIPER_systemTrustToken ?: ''}",
]) {
String customDefaultConfig = piperExecuteBin.getCustomDefaultConfigsArg()
String customConfigArg = piperExecuteBin.getCustomConfigArg(script)