-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile_CNP
109 lines (95 loc) · 3.01 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!groovy
@Library("Infrastructure")
import uk.gov.hmcts.contino.AppPipelineDsl
def type = "java"
def product = "ethos"
def component = "repl-docmosis-backend"
def branchesToSync = ['demo', 'perftest', 'ithc']
def secrets = [
'ethos-shared-${env}': [
secret('ccd-user-email', 'CCD_CASEWORKER_E2E_EMAIL'),
secret('ccd-user-password', 'CCD_CASEWORKER_E2E_PASSWORD'),
secret('ethos-repl-service-s2s-secret', 'SERVICE_SECRET'),
secret('ecm-idam-client-secret', 'IDAM_CLIENT_SECRET')
],
's2s-${env}': [
secret('microservicekey-ccd-gw', 'MICROSERVICE_CCD_GW')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
withPipeline(type, product, component) {
env.PACT_BROKER_FULL_URL = 'https://pact-broker.platform.hmcts.net'
loadVaultSecrets(secrets)
enableAksStagingDeployment()
onMaster {
disableLegacyDeployment()
}
onDemo {
disableLegacyDeployment()
}
onIthc {
disableLegacyDeployment()
}
onPerftest {
disableLegacyDeployment()
}
onMaster() {
enablePactAs([AppPipelineDsl.PactRoles.CONSUMER])
}
onPR() {
enablePactAs([AppPipelineDsl.PactRoles.CONSUMER])
}
syncBranchesWithMaster(branchesToSync)
enableSlackNotifications('#ethos-repl-service')
afterAlways('smoketest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*'
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "functional-output",
reportFiles : "ecm-e2e-result.html",
reportName : "Smoke Tests"
]
}
afterAlways('functionalTest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*'
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "functional-output",
reportFiles : "ecm-e2e-result.html",
reportName : "Functional Tests"
]
}
afterAlways('smoketest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*'
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "functional-output",
reportFiles : "ecm-e2e-result.html",
reportName : "Smoke Tests"
]
}
afterAlways('functionalTest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*'
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "functional-output",
reportFiles : "ecm-e2e-result.html",
reportName : "Functional Tests"
]
}
}