-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathJenkinsfile_CNP
131 lines (115 loc) · 3.88 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!groovy
properties([
[
$class : 'GithubProjectProperty',
displayName : 'MediaViewer',
projectUrlStr: 'https://github.com/hmcts/em-media-viewer/'
],
pipelineTriggers([
[$class: 'GitHubPushTrigger']
])
])
@Library("Infrastructure")
def type = "nodejs"
def product = "em"
def component = "media-viewer"
def channel = '#xui-pipeline'
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
env.DOCASSEMBLY_URL = "http://dg-docassembly-aat.service.core-compute-aat.internal"
env.DM_STORE_APP_URL = "http://dm-store-aat.service.core-compute-aat.internal"
env.HRS_API_URL = "http://em-hrs-api-aat.service.core-compute-aat.internal"
env.ANNOTATION_API_URL = "http://em-anno-aat.service.core-compute-aat.internal"
env.ICP_API_URL = "https://em-icp.aat.platform.hmcts.net"
env.NPA_URL = "http://em-npa-aat.service.core-compute-aat.internal"
env.IDAM_URL = "http://idam-api.aat.platform.hmcts.net"
env.S2S_URL = "http://rpe-service-auth-provider-aat.service.core-compute-aat.internal"
env.REDIRECT_URL = "https://em-show-aat.service.core-compute-aat.internal/oauth2/callback"
env.NODE_ENV="TEST"
def vaultOverrides = [
'preview' : 'aat',
]
def secrets = [
's2s-${env}': [
secret('microservicekey-em-gw', 'S2S_KEY')
],
'rpa-${env}': [
secret('show-oauth2-token', 'IDAM_SECRET')
],
'em-showcase-${env}': [
secret('ccd-user-email', 'CCD_CASEWORKER_E2E_EMAIL'),
secret('ccd-user-password', 'CCD_CASEWORKER_E2E_PASSWORD'),
secret('microservicekey-ccd-gw', 'MICROSERVICE_CCD_GW'),
secret('idam-client-secret', 'IDAM_CLIENT_SECRET')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
withPipeline(type, product, component) {
enableSlackNotifications(channel)
overrideVaultEnvironments(vaultOverrides)
loadVaultSecrets(secrets)
enableSecurityScan()
env.EXECUTE_E2E=false
env.TEST_URL = 'https://em-media-viewer-staging.service.core-compute-aat.internal/'
onPR{
env.EXECUTE_E2E=true
}
enableAksStagingDeployment()
disableLegacyDeployment()
afterSuccess('checkout') {
sh ("rm -rf node_modules")
sh ("yarn cache clean")
sh ('npm rebuild node-sass')
sh ('yarn install --check-cache')
yarnBuilder.yarn('setup')
}
afterSuccess('build') {
yarnBuilder.yarn('build')
}
afterAlways('smoketest:preview') {
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "functional-output/",
reportFiles : 'mv-e2e-result.html',
reportName : 'PREVIEW Smoke Test'
])
}
afterAlways('functionalTest:preview') {
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "functional-output/reports/html",
reportFiles : 'index.html',
reportName : 'PREVIEW Functional Test'
])
}
afterAlways('smoketest:aat') {
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "functional-output/",
reportFiles : 'mv-e2e-result.html',
reportName : 'AAT Smoke Test'
])
}
afterAlways('functionalTest:aat') {
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "functional-output/reports/html",
reportFiles : 'index.html',
reportName : 'AAT Functional Test'
])
}
}