-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile_parameterized
50 lines (46 loc) · 2.07 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
46
47
48
49
50
#!groovy
@Library(value="Infrastructure", changelog=false) _
properties([
parameters([
string(name: 'PRODUCT_NAME', defaultValue: 'finrem', description: 'Financial Remedy Application'),
string(name: 'APP', defaultValue: 'cos', description: 'Financial Remedy Case Orchestration Service'),
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\nnonprod\nprod', description: 'Azure subscriptions available to build in')
]),
[$class: 'GithubProjectProperty', projectUrlStr: 'github.com/hmcts/finrem-case-orchestration'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])
])
def secrets = [
'finrem-${env}': [
secret("finrem-doc-s2s-auth-secret", "AUTH_PROVIDER_SERVICE_CLIENT_KEY"),
secret("username-solicitor","USERNAME-SOLICITOR"),
secret("password-solicitor","PASSWORD-SOLICITOR"),
secret("idam-secret" ,"OAUTH2_CLIENT_FINREM"),
secret("finrem-system-update-username", "FINREM_SYSTEMUPDATE_USERNAME"),
secret("finrem-system-update-password", "FINREM_SYSTEMUPDATE_PASSWORD"),
secret("finrem-idam-client-secret", "FINREM_IDAM_CLIENT_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) {
loadVaultSecrets(secrets)
before('buildinfra:prod') {
error('Halting pipeline before PROD.')
}
afterSuccess('functionalTest:aat') {
publishHTML target: [
reportDir : "target/site/serenity/",
reportFiles : "index.html",
reportName : "AAT Functional Tests",
alwaysLinkToLastBuild: true
]
}
}