-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathJenkinsfile_nightly
86 lines (76 loc) · 3.37 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
#!groovy
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
properties([
pipelineTriggers([cron('37 07 * * 1-5')]),
parameters([
string(name: 'ENVIRONMENT', defaultValue: 'aat', description: 'Environment to test'),
string(name: 'test_path', defaultValue: './paths/**/*.js', description: 'any three like ./paths/probate/*.js or ./paths/generic/*.js or ./paths/intestacy/*.js'),
string(name: 'URL_TO_TEST', defaultValue: 'https://probate.aat.platform.hmcts.net', description: 'The URL you want to run these tests against'),
string(name: 'WEBCHAT_ENABLED', defaultValue: 'false', description: 'Run with webchat enabled or disabled'),
string(name: 'GA_ENABLED', defaultValue: 'false', description: 'Run with Google analytics enabled or disabled')
])
])
@Library("Infrastructure") _
String product = "probate"
String component = "frontend"
def secrets = [
'probate-${env}': [
secret('testIdamBaseUrl', 'IDAM_API_URL'),
secret('testIdamLoginUrl', 'IDAM_LOGIN_URL'),
secret('testUseIdam', 'USE_IDAM'),
secret('testInviteIdListUrl', 'INVITE_ID_LIST_URL'),
secret('testPinUrl', 'PIN_URL'),
secret('testInvitationUrl', 'INVITATION_URL'),
secret('testIdamAddUserUrl', 'IDAM_ADD_USER_URL'),
secret('testIdamRole', 'IDAM_CITIZEN_ROLE'),
secret('testIdamUserGroup', 'IDAM_USER_GROUP'),
secret('testCitizenDomain', 'CITIZEN_EMAIL_DOMAIN'),
secret('testEnvEmailAddress', 'TEST_EMAIL_ADDRESS'),
secret('testEnvMobileNumber', 'TEST_MOBILE_NUMBER'),
secret('testTerms', 'TERMS_AND_CONDITIONS'),
secret('testSurvey', 'SURVEY'),
secret('testsurveyEndOfApplication', 'SURVEY_END_OF_APPLICATION'),
secret('testPostcodeServiceUrl', 'POSTCODE_SERVICE_URL'),
secret('testPostCodeAddressToken2', 'ADDRESS_TOKEN'),
secret('testRunE2ETest', 'RUN_E2E_TEST'),
secret('testValidationServiceUrl', 'VALIDATION_SERVICE_URL'),
secret('launchdarkly-key', 'LAUNCHDARKLY_KEY'),
secret('launchdarklyUserkeyFrontend', 'LAUNCHDARKLY_USER_KEY'),
secret('webchat-avaya-url', 'WEBCHAT_AVAYA_URL'),
secret('webchat-avaya-client-url', 'WEBCHAT_AVAYA_CLIENT_URL'),
secret('webchat-avaya-service', 'WEBCHAT_AVAYA_SERVICE')
]
]
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.FE_E2E_TEST_PATH_TO_RUN = params.test_path
env.WEBCHAT_ENABLED = params.WEBCHAT_ENABLED
env.GA_ENABLED = params.GA_ENABLED
enableFullFunctionalTest(200)
enableCrossBrowserTest(120)
enableFortifyScan('probate-aat')
// enableSecurityScan() //we do this in other builds
afterAlways('build') {
sh 'mkdir -p functional-output'
yarnBuilder.yarn('setup')
}
afterAlways('fullFunctionalTest') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*'
}
afterAlways('crossBrowserTest') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*'
}
afterSuccess('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
// enableSlackNotifications('#div-dev') // can be turned back on once the overnight functionality is working fully
}