forked from hmcts/wa-task-management-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile_nightly
87 lines (71 loc) · 3.28 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
#!groovy
properties([
// H allow predefined but random minute see https://en.wikipedia.org/wiki/Cron#Non-standard_characters
pipelineTriggers([cron('H 07 * * 1-5')]),
parameters([
string(name: 'URL_TO_TEST', defaultValue: 'http://wa-task-management-api-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 = "task-management-api"
def secrets = [
'wa-${env}' : [
secret('idam-redirect-uri', 'IA_IDAM_REDIRECT_URI'),
secret('idam-secret', 'IA_IDAM_SECRET'),
secret('wa-idam-client-secret', 'WA_IDAM_CLIENT_SECRET'),
secret('wa-test-law-firm-a-username', 'TEST_WA_LAW_FIRM_USERNAME'),
secret('wa-test-law-firm-a-password', 'TEST_WA_LAW_FIRM_PASSWORD'),
secret('wa-system-username', 'WA_SYSTEM_USERNAME'),
secret('wa-system-password', 'WA_SYSTEM_PASSWORD'),
secret('ld-secret', 'LAUNCH_DARKLY_SDK_KEY'),
secret('cft-task-POSTGRES-PASS', 'POSTGRES_PASSWORD'),
secret('cft-task-POSTGRES-USER', 'POSTGRES_USERNAME'),
secret('launch-darkly-test-env-token', 'LAUNCH_DARKLY_ACCESS_TOKEN'),
],
's2s-${env}': [
secret('microservicekey-wa-task-management-api', 'S2S_SECRET_TASK_MANAGEMENT_API'),
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
withNightlyPipeline(type, product, component) {
env.TEST_URL = params.URL_TO_TEST
env.Rules = params.SecurityRules
env.POSTGRES_HOST = "cft-task-postgres-db-aat.postgres.database.azure.com"
env.IDAM_URL = "https://idam-api.aat.platform.hmcts.net"
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.OPEN_ID_IDAM_URL = "https://idam-web-public.aat.platform.hmcts.net"
env.CCD_URL = "http://ccd-data-store-api-aat.service.core-compute-aat.internal"
env.DM_STORE_URL = "http://dm-store-aat.service.core-compute-aat.internal"
env.ROLE_ASSIGNMENT_URL = "http://am-role-assignment-service-aat.service.core-compute-aat.internal"
env.PACT_BROKER_FULL_URL = "https://pact-broker.platform.hmcts.net"
env.PACT_BROKER_URL = "pact-broker.platform.hmcts.net"
env.PACT_BROKER_PORT = "443"
env.PACT_BROKER_SCHEME = "https"
env.CCD_GW_URL = "https://gateway-ccd.aat.platform.hmcts.net"
env.MAX_FT_TESTS_PARALLEL_FORKS = 3
env.INITIATION_JOB_RUNNING = false
env.WA_WORKFLOW_API_URL = "http://wa-workflow-api-aat.service.core-compute-aat.internal"
enableSecurityScan()
// disabled until we can ignore dirs from being scanned. A false positive is reported about a variable called password in a test class
// enableFortifyScan()
enableMutationTest()
loadVaultSecrets(secrets)
enableFullFunctionalTest(60)
enableSlackNotifications('#wa-build')
// after('fortify-scan') {
// steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
// }
}