generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile_nightly
108 lines (94 loc) · 4.06 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
97
98
99
100
101
102
103
104
105
106
107
108
#!groovy
properties([
[
$class : 'GithubProjectProperty',
displayName : 'Hearing Recording Service',
projectUrlStr: 'https://github.com/hmcts/em-hrs-api'
],
// 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: 'SecurityRules',
defaultValue: 'http://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 = "em"
def component = "hrs-api"
def secrets = [
's2s-${env}': [
secret('microservicekey-em-hrs-api', 'S2S_KEY'),
secret('microservicekey-ccd-gw', 'FUNCTIONAL_TEST_CCD_GW_SERVICE_SECRET'),
secret('microservicekey-em-gw', 'FUNCTIONAL_TEST_CLIENT_S2S_TOKEN')
],
'rpa-${env}': [
secret('oauth2-client-id', 'OAUTH_CLIENT_ID'),
secret('show-oauth2-token', 'IDAM_CLIENT_OAUTH_SECRET')
],
'em-hrs-api-${env}': [
secret('cvp-storage-connection-string', 'CVP_STORAGE_CONNECTION_STRING'),
secret('cvp-storage-container-name', 'CVP_STORAGE_CONTAINER_NAME'),
secret('storage-account-primary-connection-string', 'HRS_STORAGEACCOUNT_CONNECTION_STRING'),
secret('hrs-storage-container-name', 'HRS_CVP_DEST_CONTAINER_NAME'),
secret('notification-api-key', 'NOTIFICATION_API_KEY'),
secret('idam-system-user-name', 'HRS_SYSTEM_USER'),
secret('idam-system-user-password', 'HRS_SYSTEM_USER_PASSWORD'),
secret('vh-storage-container-name', 'VH_STORAGE_CONTAINER_NAME'),
secret('vh-storage-connection-string', 'VH_STORAGE_CONNECTION_STRING'),
secret('idam-system-user-name', 'IDAM_HRS_INGESTOR_SYSTEM_USER_NAME'),
secret('idam-system-user-password', 'IDAM_HRS_INGESTOR_SYSTEM_PASSWORD')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
// Vars for Kubernetes Endpoints
env.CCD_DATA_API_URL = 'http://ccd-data-store-api-aat.service.core-compute-aat.internal'
env.CCD_DEFINITION_FILE = 'hrs_ccd_case_definition_v1.0_AAT.xlsx'
env.CCD_DEF_API = 'http://ccd-definition-store-api-aat.service.core-compute-aat.internal'
env.CVP_CONTAINER_URL = 'https://emhrsapiaat.blob.core.windows.net/cvpsimulator/'
env.IDAM_API_BASE_URI = 'https://idam-api.aat.platform.hmcts.net'
env.IDAM_REDIRECT_URI = 'https://em-hrs-api-aat.service.core-compute-aat.internal/oauth2/callback'
env.OPEN_ID_API_BASE_URI = 'https://idam-web-public.aat.platform.hmcts.net/o'
env.PACT_BROKER_FULL_URL = 'https://pact-broker.platform.hmcts.net'
env.S2S_BASE_URI = 'http://rpe-service-auth-provider-aat.service.core-compute-aat.internal'
env.TEST_URL = "http://em-hrs-api-aat.service.core-compute-aat.internal/"
env.XUI_API_URL = 'https://manage-case.aat.platform.hmcts.net'
env.HRS_VH_DEST_CONTAINER_NAME = 'vhrecordings'
env.VH_STORAGE_URL= "https://emhrsapiaat.blob.core.windows.net/vhsimulator/"
env.DELETE_CASE_ENDPOINT_ENABLED = false
env.CVP_STORAGE_URL= "https://emhrsapiaat.blob.core.windows.net/cvpsimulator/"
def vaultOverrides = [
'preview' : 'aat',
'spreview': 'saat'
]
withNightlyPipeline(type, product, component) {
overrideVaultEnvironments(vaultOverrides)
loadVaultSecrets(secrets)
enableMutationTest()
enableSecurityScan()
enableFortifyScan('em-hrs-api-aat')
enableFullFunctionalTest(60)
enableSlackNotifications('#em-dev-chat')
afterAlways('functionalTest:aat') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/functional",
reportFiles : "index.html",
reportName : "HRS API Functional Test Report"
]
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
afterAlways('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
}