-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile_parameterized
45 lines (39 loc) · 1.85 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
38
39
40
41
42
43
44
#!groovy
@Library("Infrastructure") _
properties([
parameters([
string(name: 'PRODUCT_NAME', defaultValue: 'sscs', description: ''),
string(name: 'APP', defaultValue: 'tribunals-api', description: ''),
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')
]),
[$class: 'GithubProjectProperty', projectUrlStr: 'https://github.com/hmcts/tribunals-case-api'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])
])
List<LinkedHashMap<String, Object>> secrets = [
secret('idam-api', 'IDAM_API_URL'),
secret('idam-oauth-user', 'IDAM_OAUTH2_CLIENT_ID'),
secret('ccd-api', 'CORE_CASE_DATA_API_URL'),
secret('idam-redirect', 'IDAM_OAUTH2_REDIRECT_URL'),
secret('idam-sscs-systemupdate-user', 'IDAM_SSCS_SYSTEMUPDATE_USER'),
secret('idam-sscs-systemupdate-password', 'IDAM_SSCS_SYSTEMUPDATE_PASSWORD'),
secret('idam-sscs-oauth2-client-secret', 'IDAM_OAUTH2_CLIENT_SECRET'),
secret('idam-s2s-api', 'IDAM_S2S_AUTH'),
secret('sscs-s2s-secret', 'IDAM_S2S_AUTH_TOTP_SECRET'),
secret('s2s-micro', 'IDAM_S2S_AUTH_MICROSERVICE'),
secret('docmosis-endpoint', 'PDF_SERVICE_CONVERT_URL'),
secret('docmosis-api-key', 'PDF_SERVICE_ACCESS_KEY'),
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
withParameterizedPipeline(params.TYPE, params.PRODUCT_NAME, params.APP, params.ENVIRONMENT, params.SUBSCRIPTION) {
enableSlackNotifications('#sscs-tech')
loadVaultSecrets(secrets)
}