-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile_nightly
97 lines (85 loc) · 3.61 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
#!groovy
properties([
pipelineTriggers([cron('H 8 * * 1-5')]),
parameters([
string(name: 'ENVIRONMENT', defaultValue: 'aat', description: 'Environment to test'),
string(name: 'FRONTEND_URL', defaultValue: 'https://manage-case.aat.platform.hmcts.net',
description: 'The URL you want to run the full functional tests against'),
string(name: 'IDAM_API_URL', defaultValue: 'https://idam-api.aat.platform.hmcts.net',
description: 'The URL of idam api'),
string(name: 'DM_STORE_URL', defaultValue: 'http://dm-store-aat.service.core-compute-aat.internal',
description: 'The URL of dm store'),
string(name: 'SERVICE_AUTH_PROVIDER_API_BASE_URL', defaultValue: 'http://rpe-service-auth-provider-aat.service.core-compute-aat.internal',
description: 'The URL of service auth provider'),
string(name: 'CCD_DATA_STORE_URL', defaultValue: 'http://ccd-data-store-api-aat.service.core-compute-aat.internal',
description: 'The URL of ccd data store'),
string(name: 'AAC_API_URL', defaultValue: 'http://aac-manage-case-assignment-aat.service.core-compute-aat.internal',
description: 'The URL of AAC service'),
string(name: 'CIVIL_SERVICE_URL', defaultValue: 'http://civil-service-aat.service.core-compute-aat.internal',
description: 'The URL of civil service'),
string(name: 'WAIT_FOR_TIMEOUT_MS',
defaultValue: '120000',
description: 'Functional tests waitForTimeout value'),
string(name: 'SECURITY_RULES',
defaultValue: 'https://raw.githubusercontent.com/hmcts/security-test-rules/master/conf/security-rules.conf',
description: 'The security rules to use')
])
])
@Library("Infrastructure")
def type = "java"
def product = "civil"
def component = "service"
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
def ccdBranch = "master"
static Map<String, Object> secret(String secretName, String envVariable) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
envVariable: envVariable
]
}
def secrets = [
'civil-${env}': [
secret('microservicekey-civil-service', 'S2S_SECRET'),
secret('default-password', 'DEFAULT_PASSWORD'),
secret('judge-default-password', 'JUDGE_DEFAULT_PASSWORD'),
secret('iac-default-password', 'IAC_DEFAULT_PASSWORD'),
secret('generic-docker-pact-broker-password', 'GENERIC_DOCKER_PACT_BROKER_YAML_PASS')
]
]
withNightlyPipeline(type, product, component) {
env.URL = params.FRONTEND_URL
env.DM_STORE_URL=params.DM_STORE_URL
env.IDAM_API_URL=params.IDAM_API_URL
env.SERVICE_AUTH_PROVIDER_API_BASE_URL = params.SERVICE_AUTH_PROVIDER_API_BASE_URL
env.CCD_DATA_STORE_URL = params.CCD_DATA_STORE_URL
env.CIVIL_SERVICE_URL = params.CIVIL_SERVICE_URL
env.WAIT_FOR_TIMEOUT_MS = params.WAIT_FOR_TIMEOUT_MS
env.URL_FOR_SECURITY_SCAN = params.CIVIL_SERVICE_URL
env.TESTS_FOR_ACCESSIBILITY = true
env.NIGHTLY_RUN = true
env.AAC_API_URL = params.AAC_API_URL
overrideVaultEnvironments([
'aat': params.ENVIRONMENT
])
loadVaultSecrets(secrets)
//enableMutationTest()
enableFortifyScan()
//enableSecurityScan()
enableFullFunctionalTest(200)
before('fullFunctionalTest') {
sh """
./bin/pull-latest-ccd-files.sh ${ccdBranch}
"""
yarnBuilder.yarn('yarn-update')
yarnBuilder.yarn('install-dependencies')
yarnBuilder.yarn('playwright install')
}
afterAlways('fullFunctionalTest') {
archiveArtifacts allowEmptyArchive: true, artifacts: 'test-results/functional/**/*'
env.TESTS_FOR_ACCESSIBILITY = false
}
afterAlways('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
}