-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile_parameterized
41 lines (36 loc) · 1.48 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
#!groovy
@Library("Infrastructure")
def product = "ccpay"
def component = "bubble-frontend"
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
List<LinkedHashMap<String, Object>> secrets = [
secret('paybubble-s2s-secret', 'PAYBUBBLE_S2S_TOTP_SECRET'),
secret('paybubble-idam-client-secret', 'IDAM_CLIENT_SECRET'),
secret('launch-darkly-client-id', 'LD_CLIENT_ID'),
secret('postcode-address-lookup-id', 'POSTCODE_ADDRESS_LOOKUP_ID')
]
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: 'bubble-frontend', description: ''),
string(name: 'APP', defaultValue: 'web', description: ''),
string(name: 'TYPE', defaultValue: 'nodejs', description: ''),
choice(name: 'ENVIRONMENT', choices: 'saat\nsprod\nsandbox', 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/ccpay-bubble'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])
])
withParameterizedPipeline(params.TYPE, params.PRODUCT_NAME, params.APP, params.ENVIRONMENT, params.SUBSCRIPTION) {
afterAlways('build') {
yarnBuilder.yarn('ng:build')
}
loadVaultSecrets(secrets)
}