generated from hmcts/expressjs-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile_nightly
69 lines (57 loc) · 2.17 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
#!groovy
properties([
// H allow predefined but random minute see https://en.wikipedia.org/wiki/Cron#Non-standard_characters
pipelineTriggers([cron('H 16 * * 1-5')]),
parameters([
string(name: 'TEST_URL', defaultValue: 'https://nfdiv.aat.platform.hmcts.net', description: 'The URL you want to run tests against'),
])
])
@Library("Infrastructure")
import uk.gov.hmcts.contino.AppPipelineConfig
def type = "nodejs"
def product = "nfdiv"
def component = "frontend"
// SAUCELABS config - configured on Jenkins
env.SAUCE_USERNAME = 'username'
env.SAUCE_ACCESS_KEY = 'privatekey'
env.SAUCE_TUNNEL_IDENTIFIER = 'reformtunnel'
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
static Map<String, Object> secret(String secretName, String envVariable) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
envVariable: envVariable
]
}
def secrets = [
'nfdiv-${env}' :[
secret('e2e-test-user-password', 'TEST_PASSWORD'),
secret('frontend-secret', 'SERVICE_AUTH_SECRET'),
secret('idam-secret', 'IDAM_SECRET'),
secret('pcq-token-key', 'PCQ_TOKEN'),
secret('playwright-service-url', 'PLAYWRIGHT_SERVICE_URL'),
secret('playwright-token', 'PLAYWRIGHT_SERVICE_ACCESS_TOKEN'),
]
]
def pipelineConf = new AppPipelineConfig()
pipelineConf.vaultSecrets = secrets
withNightlyPipeline(type, product, component) {
//enableFortifyScan()
//afterSuccess('fortify-scan') { steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*' }
enableCrossBrowserTest()
enableFullFunctionalTest()
loadVaultSecrets(secrets)
enableFortifyScan()
before('crossBrowserTest') {
yarnBuilder.smokeTest()
}
afterAlways('crossBrowserTest') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/crossbrowser/reports/**/*'
}
afterAlways('fullFunctionalTest') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/functional/reports/**/*'
}
afterAlways('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
}