1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00

Parse values to json with groovy methods (#1266)

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
This commit is contained in:
Kaj-Sören Mossdorf 2020-03-19 14:46:56 +01:00 committed by GitHub
parent 6feb0cf9e9
commit 5616ac2ab0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@ import com.sap.piper.ConfigurationLoader
import com.sap.piper.ConfigurationMerger
import com.sap.piper.DefaultValueCache
import com.sap.piper.analytics.InfluxData
import com.sap.piper.JsonUtils
import groovy.json.JsonOutput
class commonPipelineEnvironment implements Serializable {
@ -180,7 +180,7 @@ class commonPipelineEnvironment implements Serializable {
if(value instanceof String) {
script.writeFile file: fileName, text: value
} else {
script.writeFile file: fileName, text: JsonUtils.groovyObjectToJsonString(value)
script.writeFile file: fileName, text: groovy.json.JsonOutput.toJson(value)
}
}
})
@ -191,7 +191,7 @@ class commonPipelineEnvironment implements Serializable {
if(value instanceof String) {
script.writeFile file: fileName, text: value
} else {
script.writeFile file: fileName, text: JsonUtils.groovyObjectToJsonString(value)
script.writeFile file: fileName, text: groovy.json.JsonOutput.toJson(value)
}
}
})