-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile_parameterized
37 lines (32 loc) · 1.49 KB
/
Jenkinsfile_parameterized
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!groovy
@Library(value="Infrastructure", changelog=false) _
properties([
parameters([
string(name: 'PRODUCT_NAME', defaultValue: 'div', description: 'Divorce'),
string(name: 'COMPONENT', defaultValue: 'cos', description: 'Default Case Orchestration Service'),
string(name: 'TYPE', defaultValue: 'java', description: ''),
string(name: 'ENVIRONMENT', defaultValue: 'saat', description: 'Environment where code should be build and deployed'),
choice(name: 'SUBSCRIPTION', choices: 'sandbox\nnonprod\nprod', description: 'Azure subscriptions available to build in')
])
])
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
def secrets = [
'div-${env}': [
secret("ccd-submission-s2s-auth-secret", "AUTH_PROVIDER_CCDSUBMISSION_CLIENT_KEY"),
secret("div-doc-s2s-auth-secret", "AUTH_PROVIDER_DOCUMENTGENERATOR_CLIENT_KEY"),
secret("idam-secret", "IDAM_CLIENT_SECRET")
]
]
withParameterizedPipeline(params.TYPE, params.PRODUCT_NAME, params.COMPONENT, params.ENVIRONMENT, params.SUBSCRIPTION) {
loadVaultSecrets(secrets)
afterSuccess('functionalTest:saat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
}