forked from hmcts/sscs-cor-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile_nightly
73 lines (62 loc) · 2.66 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
#!groovy
properties([
pipelineTriggers([cron('00 08 * * *')]),
parameters([
string(name: 'URL_TO_TEST', defaultValue: 'https://sscs-cor.aat.platform.hmcts.net', description: 'The URL you want to run these tests against'),
string(name: 'TRIBUNALS_API_URI', defaultValue: 'http://sscs-tribunals-api-aat.service.core-compute-aat.internal', description: 'Tribunal URL to create test data'),
string(name: 'IDAM_API_URL', defaultValue: 'https://idam-api.aat.platform.hmcts.net', description: 'Idam URL you want to create test account'),
string(name: 'SecurityRules',
defaultValue: 'http://raw.githubusercontent.com/hmcts/security-test-rules/master/conf/security-rules.conf',
description: 'The URL you want to run these tests against'),
])
])
@Library("Infrastructure")
def product = "sscs-cor"
def component = "frontend"
def secrets = [
'sscs-${env}': [
secret('sscs-s2s-secret', 'S2S_SECRET'),
secret('sscs-cor-idam-client-secret-test', 'IDAM_CLIENT_SECRET_TEST'),
secret('sscs-cor-idam-client-secret', 'IDAM_CLIENT_SECRET_AAT'),
secret('idam-sscs-systemupdate-user', 'IDAM_SSCS_SYSTEMUPDATE_USER'),
secret('idam-sscs-systemupdate-password', 'IDAM_SSCS_SYSTEMUPDATE_PASSWORD'),
secret('idam-sscs-oauth2-client-secret', 'IDAM_OAUTH2_CLIENT_SECRET')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
withNightlyPipeline("nodejs", product, component) {
loadVaultSecrets(secrets)
env.TEST_URL = params.URL_TO_TEST
env.TRIBUNALS_API_URL = params.TRIBUNALS_API_URI
env.IDAM_API_URL = params.IDAM_API_URL
before('DependencyCheckNightly') {sh 'yarn test:audit'}
enableSecurityScan()
enableFortifyScan('sscs-aat')
enableCrossBrowserTest()
enableFullFunctionalTest(20)
enableSlackNotifications('#sscs-tech')
enableMutationTest()
after('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
after('crossBrowserTest') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*'
}
after('fullFunctionalTest') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "output",
reportFiles : "SSCS-e2e-result.html",
reportName : "SSCS E2E functional tests result"
]
}
}