This repository has been archived by the owner on Jun 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile_nightly
104 lines (90 loc) · 2.98 KB
/
Jenkinsfile_nightly
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
#!groovy
properties([
[
$class : 'GithubProjectProperty',
displayName : 'Judicial UI Web App',
projectUrlStr: 'https://github.com/hmcts/rpa-jui-webapp/'
],
pipelineTriggers([
cron('H 05 * * *')
])
])
@Library("Infrastructure")
def type = "nodejs"
def product = "jui"
def component = "webapp"
def vault = "rpa"
def channel = '#jui-pipeline'
List<LinkedHashMap<String, Object>> secrets = [
secret('test-email', 'TEST_EMAIL'),
secret('test-password', 'TEST_PASSWORD'),
secret('jui-s2s-token', 'S2S_SECRET'),
secret('decrypt-key', 'DECRYPT_KEY'),
secret('jui-oauth2-token', 'IDAM_SECRET'),
secret('fr-email', 'FR_EMAIL'),
secret('fr-password', 'FR_PASSWORD'),
secret('sscs-email', 'SSCS_EMAIL'),
secret('sscs-password', 'SSCS_PASSWORD')
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
withNightlyPipeline(type, product, component) {
enableSlackNotifications(channel)
loadVaultSecrets(secrets)
setVaultName(vault)
// enablePerformanceTest(15)
// enableApiGatewayTest(15)
enableFullFunctionalTest(30)
// enableMutationTest(120)
enableCrossBrowserTest(120)
enableDockerBuild()
enableDeployToAKS()
env.TEST_URL = 'https://jui-webapp-aat.service.core-compute-aat.internal'
after('checkout') {sh 'yarn cache clean'}
after('build') {
sh 'npm run build'
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "test/reports/lint/node/",
reportFiles : 'index.html',
reportName : 'node lint Report'
])
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "test/reports/lint/ng/",
reportFiles : 'index.html',
reportName : 'ng lint Report'
])
}
after('crossBrowserTest') {
//steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*',
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/crossbrowser/",
reportFiles : 'index.html',
reportName : 'JUI Cross Browser Test Report'
])
}
after('fullFunctionalTest') {
publishHTML([
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "reports/tests/functional/",
reportFiles : 'index.html',
reportName : 'JUI Full Functional Test Report'
])
}
}