mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-03-03 15:02:35 +02:00
Add configuration support for postActions (#135)
This commit is contained in:
parent
286a1f082e
commit
e8fb41aab6
@ -33,6 +33,11 @@ class ConfigurationLoader implements Serializable {
|
||||
return DefaultValueCache.getInstance()?.getDefaultValues()?.general ?: [:]
|
||||
}
|
||||
|
||||
@NonCPS
|
||||
static Map postActionConfiguration(script, String actionName){
|
||||
return loadConfiguration(script, 'postActions', actionName, ConfigurationType.CUSTOM_CONFIGURATION)
|
||||
}
|
||||
|
||||
@NonCPS
|
||||
private static Map loadConfiguration(script, String type, String entryName, ConfigurationType configType){
|
||||
switch (configType) {
|
||||
|
@ -10,6 +10,7 @@ class ConfigurationLoaderTest {
|
||||
configuration.general = [productiveBranch: 'master']
|
||||
configuration.steps = [executeMaven: [dockerImage: 'maven:3.2-jdk-8-onbuild']]
|
||||
configuration.stages = [staticCodeChecks: [pmdExcludes: '**']]
|
||||
configuration.postActions = [sendEmail: [recipients: 'myEmail']]
|
||||
|
||||
Map defaultConfiguration = [:]
|
||||
defaultConfiguration.general = [productiveBranch: 'develop']
|
||||
@ -56,4 +57,10 @@ class ConfigurationLoaderTest {
|
||||
Map config = ConfigurationLoader.defaultGeneralConfiguration(getScript())
|
||||
Assert.assertEquals('develop', config.productiveBranch)
|
||||
}
|
||||
|
||||
@Test
|
||||
void testLoadPostActionConfiguration(){
|
||||
Map config = ConfigurationLoader.postActionConfiguration(getScript(), 'sendEmail')
|
||||
Assert.assertEquals('myEmail', config.recipients)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user