-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsfile_nightly
71 lines (61 loc) · 2.75 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
#!groovy
properties([
// H allow predefined but random minute see https://en.wikipedia.org/wiki/Cron#Non-standard_characters
pipelineTriggers([cron('H 8 * * 1-5')]),
parameters([
string(name: 'URL_TO_TEST', defaultValue: 'http://wa-case-event-handler-aat.service.core-compute-aat.internal', description: 'The URL you want to run these tests against'),
string(name: 'SecurityRules',
defaultValue: 'https://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 type = "java"
def product = "wa"
def component = "case-event-handler"
def secrets = [
'wa-${env}' : [
secret('ld-secret', 'LAUNCH_DARKLY_SDK_KEY'),
secret('wa-case-event-handler-POSTGRES-PASS-V15', 'POSTGRES_PASSWORD'),
secret('wa-case-event-handler-POSTGRES-USER-V15', 'POSTGRES_USERNAME'),
secret('wa-case-event-handler-POSTGRES-HOST-V15', 'POSTGRES_HOST'),
secret('wa-case-event-handler-POSTGRES-PORT-V15', 'POSTGRES_PORT'),
secret('idam-redirect-uri', 'IA_IDAM_REDIRECT_URI'),
secret('idam-secret', 'IA_IDAM_SECRET'),
secret('wa-idam-client-secret', 'WA_IDAM_CLIENT_SECRET'),
],
's2s-${env}': [
secret('microservicekey-wa-case-event-handler', 'S2S_SECRET_CASE_EVENT_HANDLER')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
// Prevent Docker hub rate limit errors by ensuring that testcontainers uses images from hmctspublic ACR
env.TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX = "hmctspublic.azurecr.io/imported/"
withNightlyPipeline(type, product, component) {
env.TEST_URL = params.URL_TO_TEST
env.Rules = params.SecurityRules
env.S2S_URL = "http://rpe-service-auth-provider-aat.service.core-compute-aat.internal"
env.CAMUNDA_URL = "http://camunda-api-aat.service.core-compute-aat.internal/engine-rest"
env.WA_TASK_MANAGEMENT_API_URL = "http://wa-task-management-api-aat.service.core-compute-aat.internal"
env.DM_STORE_URL = "http://dm-store-aat.service.core-compute-aat.internal"
env.IDAM_URL = "https://idam-api.aat.platform.hmcts.net"
env.ROLE_ASSIGNMENT_URL = "http://am-role-assignment-service-aat.service.core-compute-aat.internal"
env.CCD_URL = "http://ccd-data-store-api-aat.service.core-compute-aat.internal"
env.MAX_FT_TESTS_PARALLEL_FORKS = 3
loadVaultSecrets(secrets)
enableSecurityScan()
enableFortifyScan()
enableMutationTest()
enableFullFunctionalTest()
enableSlackNotifications('#wa-build')
afterSuccess('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
}