-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile_parameterized
30 lines (27 loc) · 1.05 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
#!groovy
@Library(value="Infrastructure", changelog=false) _
properties([
parameters([
choice(name: 'ENVIRONMENT', choices: 'saat\nsprod\nsandbox', description: 'Environment where code should be build and deployed')
]),
[$class: 'GithubProjectProperty', projectUrlStr: 'github.com/hmcts/ccfr-fees-register-app'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])
])
List<LinkedHashMap<String, Object>> secrets = [
secret('freg-idam-test-user-password', 'TEST_USER_PASSWORD'),
secret('freg-idam-generated-user-email-pattern', 'GENERATED_USER_EMAIL_PATTERN'),
secret('freg-idam-client-secret', 'OAUTH2_CLIENT_SECRET')
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
withParameterizedPipeline('java', 'fees-register', 'api', params.ENVIRONMENT, 'sandbox') {
setVaultName('fees-register')
loadVaultSecrets(secrets)
enableDbMigration()
}