-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathJenkinsfile_parameterized
45 lines (39 loc) · 1.52 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
45
#!groovy
@Library("Infrastructure")
secrets = [
's2s-${env}': [
secret('microservicekey-send-letter-tests', 'TEST_S2S_SECRET')
],
'rpe-send-letter-${env}': [
secret('ftp-user', 'TEST_FTP_USER'),
secret('ftp-private-key', 'TEST_FTP_PRIVATE_KEY'),
secret('ftp-public-key', 'TEST_FTP_PUBLIC_KEY'),
secret('launch-darkly-sdk-key', 'LAUNCH_DARKLY_SDK_KEY'),
secret('launch-darkly-offline-mode', 'LAUNCH_DARKLY_OFFLINE_MODE')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
properties([
parameters([
string(name: 'PRODUCT_NAME', defaultValue: 'rpe', description: ''),
string(name: 'APP', defaultValue: 'send-letter-service', description: ''),
string(name: 'TYPE', defaultValue: 'java', description: ''),
string(name: 'ENVIRONMENT', defaultValue: 'sandbox', description: 'Environment where code should be build and deployed'),
choice(name: 'SUBSCRIPTION', choices: 'sandbox', description: 'Azure subscriptions available to build in')
]),
[$class: 'GithubProjectProperty', projectUrlStr: 'github.com/hmcts/send-letter-service'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])
])
def channel = '#bsp-build-notices'
withParameterizedPipeline(params.TYPE, params.PRODUCT_NAME, params.APP, params.ENVIRONMENT, params.SUBSCRIPTION) {
enableDbMigration('rpe-send-letter')
enableSlackNotifications(channel)
loadVaultSecrets(secrets)
}