mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
Merge pull request #91 from alejandraferreirovidal/mtaJarLocationStepConfig
mtaJarLocation as step configuration
This commit is contained in:
commit
9205187631
@ -46,19 +46,4 @@ class ConfigurationMerger {
|
||||
|
||||
return merged
|
||||
}
|
||||
|
||||
@NonCPS
|
||||
def static merge(
|
||||
Map parameters, Set parameterKeys,
|
||||
Map generalConfigurationMap, Set generalConfigurationKeys, Map generalConfigurationDefaults,
|
||||
Map stepConfigurationMap, Set stepConfigurationKeys, Map stepConfigurationDefaults=[:]
|
||||
){
|
||||
Map merged
|
||||
Map mergedStepConfiguration = merge(stepConfigurationMap, stepConfigurationKeys, stepConfigurationDefaults)
|
||||
Map mergedGeneralConfiguration = merge(generalConfigurationMap, generalConfigurationKeys, generalConfigurationDefaults)
|
||||
merged = merge(mergedGeneralConfiguration, null, mergedStepConfiguration)
|
||||
merged = merge(parameters, parameterKeys, merged)
|
||||
|
||||
return merged
|
||||
}
|
||||
}
|
||||
|
@ -178,13 +178,13 @@ public class MTABuildTest extends BasePipelineTest {
|
||||
@Test
|
||||
void mtaJarLocationFromCustomStepConfigurationTest() {
|
||||
|
||||
cpe.configuration = [general:[mtaJarLocation: '/general/mta']]
|
||||
cpe.configuration = [steps:[mtaBuild:[mtaJarLocation: '/step/mta']]]
|
||||
|
||||
mtaBuildScript.call(script: [commonPipelineEnvironment: cpe],
|
||||
buildTarget: 'NEO')
|
||||
|
||||
assert jscr.shell[1].contains('-jar /general/mta/mta.jar --mtar')
|
||||
assert jlr.log.contains('[mtaBuild] MTA JAR "/general/mta/mta.jar" retrieved from configuration.')
|
||||
assert jscr.shell[1].contains('-jar /step/mta/mta.jar --mtar')
|
||||
assert jlr.log.contains('[mtaBuild] MTA JAR "/step/mta/mta.jar" retrieved from configuration.')
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,10 +12,7 @@ def call(Map parameters = [:]) {
|
||||
]
|
||||
|
||||
Set stepConfigurationKeys = [
|
||||
'buildTarget'
|
||||
]
|
||||
|
||||
Set generalConfigurationKeys = [
|
||||
'buildTarget',
|
||||
'mtaJarLocation'
|
||||
]
|
||||
|
||||
@ -27,10 +24,8 @@ def call(Map parameters = [:]) {
|
||||
|
||||
final Map stepConfiguration = ConfigurationLoader.stepConfiguration(script, stepName)
|
||||
final Map stepDefaults = ConfigurationLoader.defaultStepConfiguration(script, stepName)
|
||||
final Map generalConfiguration = ConfigurationLoader.generalConfiguration(script)
|
||||
final Map configuration = ConfigurationMerger.merge(
|
||||
parameters, parameterKeys,
|
||||
generalConfiguration, generalConfigurationKeys, [:],
|
||||
stepConfiguration, stepConfigurationKeys, stepDefaults)
|
||||
|
||||
def mtaYaml = readYaml file: "${pwd()}/mta.yaml"
|
||||
|
Loading…
Reference in New Issue
Block a user