-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathJenkinsfile_parameterized
60 lines (54 loc) · 2.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!groovy
//noinspection GroovyUnusedAssignment
@Library("Infrastructure") _
//noinspection GroovyAssignabilityCheck
properties([
parameters([
choice(name: 'ENVIRONMENT', choices: 'sandbox\nsaat\nsprod\nnonprod\nprod', description: 'Environment where code should be build and deployed')
])
])
List<LinkedHashMap<String, Object>> secrets = [
secret('serviceAuthProviderBaseUrl', 'SERVICE_AUTH_PROVIDER_BASE_URL'),
secret('userAuthProviderOauth2Url', 'USER_AUTH_PROVIDER_OAUTH2_URL'),
secret('evidenceManagementUrl', 'EVIDENCE_MANAGEMENT_URL'),
secret('idamUserId', 'IDAM_USER_ID'),
secret('s2sAuthTotpSecret', 'S2S_AUTH_TOTP_SECRET'),
secret('probateCcdDataStoreApi', 'CCD_DATA_STORE_API_URL'),
secret('probate-bo-govNotifyApiKey', 'PROBATE_BO_NOTIFY_KEY'),
secret('pdf-service-grantSignatureBase64-first', 'BO_GRANT_SIG_FIRST'),
secret('pdf-service-grantSignatureBase64-last','BO_GRANT_SIG_LAST'),
secret('schedulerCaseWorkerUser','SCHEDULER_CASEWORKER_USERNAME'),
secret('schedulerCaseWorkerPass','SCHEDULER_CASEWORKER_PASSWORD')
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
withParameterizedPipeline('java', 'probate', 'back-office', params.ENVIRONMENT, 'sandbox') {
loadVaultSecrets(secrets)
// after('build') {
// try {
// sh './gradlew pitest'
// } finally {
// steps.archiveArtifacts "build/reports/pitest/**/*.*"
// }
// }
// after('functionalTest:saat') {
// publishHTML target: [
// reportDir : "target/site/serenity/",
// reportFiles : "index.html",
// reportName : "SAAT Functional Tests",
// alwaysLinkToLastBuild: true
// ]
// }
after('functionalTest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
after('functionalTest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
}