2017-07-11 15:12:03 +02:00
|
|
|
class commonPipelineEnvironment implements Serializable {
|
|
|
|
private Map configProperties = [:]
|
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
//stores version of the artifact which is build during pipeline run
|
|
|
|
def artifactVersion
|
|
|
|
|
2018-02-07 14:17:33 +02:00
|
|
|
//stores the gitCommitId as well as additional git information for the build during pipeline run
|
2018-09-21 09:24:47 +02:00
|
|
|
private String gitCommitId
|
|
|
|
private String gitSshUrl
|
2018-02-07 14:17:33 +02:00
|
|
|
|
|
|
|
//stores properties for a pipeline which build an artifact and then bundles it into a container
|
|
|
|
private Map appContainerProperties = [:]
|
|
|
|
|
2017-12-06 13:03:06 +02:00
|
|
|
Map configuration = [:]
|
2018-01-24 10:55:38 +02:00
|
|
|
Map defaultConfiguration = [:]
|
|
|
|
|
|
|
|
//each Map in influxCustomDataMap represents a measurement in Influx. Additional measurements can be added as a new Map entry of influxCustomDataMap
|
2018-05-30 12:00:13 +02:00
|
|
|
private Map influxCustomDataMap = [pipeline_data: [:], step_data: [:]]
|
2018-01-24 10:55:38 +02:00
|
|
|
//influxCustomData represents measurement jenkins_custom_data in Influx. Metrics can be written into this map
|
|
|
|
private Map influxCustomData = [:]
|
2017-12-06 13:03:06 +02:00
|
|
|
|
2018-09-21 09:24:47 +02:00
|
|
|
private String mtarFilePath
|
2017-07-11 15:12:03 +02:00
|
|
|
|
2018-05-30 12:00:13 +02:00
|
|
|
def reset() {
|
|
|
|
appContainerProperties = [:]
|
|
|
|
artifactVersion = null
|
|
|
|
|
|
|
|
configProperties = [:]
|
|
|
|
configuration = [:]
|
|
|
|
|
|
|
|
gitCommitId = null
|
|
|
|
gitSshUrl = null
|
|
|
|
|
|
|
|
influxCustomData = [:]
|
|
|
|
influxCustomDataMap = [pipeline_data: [:], step_data: [:]]
|
|
|
|
|
|
|
|
mtarFilePath = null
|
|
|
|
}
|
|
|
|
|
2018-02-07 14:17:33 +02:00
|
|
|
def setAppContainerProperty(property, value) {
|
|
|
|
appContainerProperties[property] = value
|
|
|
|
}
|
|
|
|
|
|
|
|
def getAppContainerProperty(property) {
|
|
|
|
return appContainerProperties[property]
|
|
|
|
}
|
|
|
|
|
2018-09-21 09:24:47 +02:00
|
|
|
def setArtifactVersion(version) {
|
|
|
|
artifactVersion = version
|
|
|
|
}
|
|
|
|
|
|
|
|
def getArtifactVersion() {
|
|
|
|
return artifactVersion
|
|
|
|
}
|
|
|
|
|
|
|
|
def setConfigProperties(map) {
|
|
|
|
configProperties = map
|
|
|
|
}
|
|
|
|
|
|
|
|
def getConfigProperties() {
|
|
|
|
return configProperties
|
|
|
|
}
|
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
def setConfigProperty(property, value) {
|
|
|
|
configProperties[property] = value
|
|
|
|
}
|
2017-11-24 16:59:34 +02:00
|
|
|
|
2017-07-11 15:12:03 +02:00
|
|
|
def getConfigProperty(property) {
|
|
|
|
if (configProperties[property] != null)
|
|
|
|
return configProperties[property].trim()
|
|
|
|
else
|
|
|
|
return configProperties[property]
|
|
|
|
}
|
2017-11-24 16:59:34 +02:00
|
|
|
|
2018-09-21 09:24:47 +02:00
|
|
|
def setGitCommitId(commitId) {
|
|
|
|
gitCommitId = commitId
|
|
|
|
}
|
|
|
|
|
|
|
|
def getGitCommitId() {
|
|
|
|
return gitCommitId
|
|
|
|
}
|
|
|
|
|
|
|
|
def setGitSshUrl(url) {
|
|
|
|
gitSshUrl = url
|
|
|
|
}
|
|
|
|
|
|
|
|
def getGitSshUrl() {
|
|
|
|
return gitSshUrl
|
|
|
|
}
|
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
def getInfluxCustomData() {
|
|
|
|
return influxCustomData
|
|
|
|
}
|
|
|
|
|
|
|
|
def getInfluxCustomDataMap() {
|
|
|
|
return influxCustomDataMap
|
|
|
|
}
|
|
|
|
|
2018-08-15 11:41:01 +02:00
|
|
|
def setInfluxStepData (dataKey, value) {
|
|
|
|
influxCustomDataMap.step_data[dataKey] = value
|
|
|
|
}
|
|
|
|
def getInfluxStepData (dataKey) {
|
|
|
|
return influxCustomDataMap.step_data[dataKey]
|
|
|
|
}
|
|
|
|
|
2018-09-21 09:24:47 +02:00
|
|
|
|
|
|
|
def getMtarFilePath() {
|
|
|
|
return mtarFilePath
|
|
|
|
}
|
|
|
|
|
|
|
|
void setMtarFilePath(mtarFilePath) {
|
|
|
|
this.mtarFilePath = mtarFilePath
|
|
|
|
}
|
|
|
|
|
2018-01-24 10:55:38 +02:00
|
|
|
def setPipelineMeasurement (measurementName, value) {
|
|
|
|
influxCustomDataMap.pipeline_data[measurementName] = value
|
|
|
|
}
|
|
|
|
|
|
|
|
def getPipelineMeasurement (measurementName) {
|
|
|
|
return influxCustomDataMap.pipeline_data[measurementName]
|
|
|
|
}
|
2017-07-11 15:12:03 +02:00
|
|
|
}
|