-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile_parameterized
36 lines (31 loc) · 1.24 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
#!groovy
@Library(value="Infrastructure", changelog=false) _
def channel = '#bsp-build-notices'
properties([
parameters([
string(name: 'PRODUCT_NAME', defaultValue: 'bulk-scan', description: ''),
string(name: 'APP', defaultValue: 'sample-app', description: ''),
string(name: 'TYPE', defaultValue: 'java', description: ''),
string(name: 'ENVIRONMENT', defaultValue: 'sandbox', description: 'Environment where code should be built and deployed'),
choice(name: 'SUBSCRIPTION', choices: 'sandbox\nnonprod\nprod', description: 'Azure subscriptions available to build in')
]),
[$class: 'GithubProjectProperty', projectUrlStr: 'github.com/hmcts/bulk-scan-ccd-event-handler-sample-app'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])
])
def secrets = [
's2s-${env}': [
secret('microservicekey-bulk-scan-sample-app-tests', 'TEST_S2S_SECRET')
]
]
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(channel)
loadVaultSecrets(secrets)
}