This repository has been archived by the owner on May 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Jenkinsfile_parameterized
38 lines (33 loc) · 1.37 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
#!groovy
@Library("Infrastructure") _
def channel = '#rpe-build-notices'
List<LinkedHashMap<String, Object>> secrets = [
secret('admin-username-test', 'ADMIN_USERNAME_TEST'),
secret('admin-password-test', 'ADMIN_PASSWORD_TEST'),
secret('editor-username-test', 'EDITOR_USERNAME_TEST'),
secret('editor-password-test', 'EDITOR_PASSWORD_TEST')
]
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: 'feature-toggle-api', 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', description: 'Azure subscriptions available to build in')
]),
[$class: 'GithubProjectProperty', projectUrlStr: 'github.com/hmcts/feature-toggle-api'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])
])
withParameterizedPipeline(params.TYPE, params.PRODUCT_NAME, params.APP, params.ENVIRONMENT, params.SUBSCRIPTION) {
enableDbMigration()
enableSlackNotifications(channel)
loadVaultSecrets(secrets)
}