-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile_CNP
95 lines (79 loc) · 2.79 KB
/
Jenkinsfile_CNP
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!groovy
import uk.gov.hmcts.contino.AppPipelineDsl
@Library("Infrastructure")
String product = "probate"
String component = "business-service"
def secrets = [
'probate-${env}': [
secret('probatePersistenceUrl', 'TEST_PERSISTENCE_URL'),
secret('probateNotifyMobile', 'TEST_MOBILE'),
secret('pdfservice-url', 'TEST_PDFSERVICE_URL'),
secret('serviceAuthProviderBaseUrl', 'SERVICE_AUTH_PROVIDER_BASE_URL'),
secret('s2sAuthTotpSecret', 'S2S_AUTH_TOTP_SECRET'),
secret('probateIdamSecret', 'IDAM_SECRET'),
secret('probateIdamUserName', 'IDAM_USERNAME'),
secret('probateIdamPassword', 'IDAM_USERPASSWORD'),
secret('probate-notify-invite-apikey', 'PROBATE_NOTIFY_KEY')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
// Vars for Kubernetes
env.PACT_BROKER_FULL_URL = 'https://pact-broker.platform.hmcts.net'
// Configure branches to sync with master branch
def branchesToSync = ['demo', 'ithc', 'perftest']
withPipeline("java", product, component) {
loadVaultSecrets(secrets)
enableAksStagingDeployment()
disableLegacyDeployment()
enableSlackNotifications('#probate-jenkins')
syncBranchesWithMaster(branchesToSync)
afterSuccess('test') {
publishHTML target: [
alwaysLinkToLastBuild: true,
reportDir : "build/reports/tests/test",
reportFiles : "index.html",
reportName : "sol-ccd-service Test Report"
]
publishHTML target: [
alwaysLinkToLastBuild: true,
reportDir : "build/reports/jacoco",
reportFiles : "index.html",
reportName : "sol-ccd-service Code Coverage Report"
]
}
afterSuccess('functionalTest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "target/site/serenity/",
reportFiles : "index.html",
reportName : "Functional Tests Report"
]
}
afterSuccess('functionalTest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "target/site/serenity/",
reportFiles : "index.html",
reportName : "Functional Tests Report"
]
}
onMaster() {
enablePactAs([AppPipelineDsl.PactRoles.CONSUMER])
}
onPR() {
enablePactAs([AppPipelineDsl.PactRoles.CONSUMER])
}
}