-
Notifications
You must be signed in to change notification settings - Fork 8
/
Jenkinsfile_nightly
122 lines (107 loc) · 5.55 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!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: 'ENVIRONMENT', defaultValue: 'aat', description: 'Environment to test'),
string(name: 'URL_TO_TEST', defaultValue: 'http://payment-api-aat.service.core-compute-aat.internal', description: 'The URL you want to run these tests against'),
string(name: 'REFUND_API_URL', defaultValue: 'http://ccpay-refunds-api-aat.service.core-compute-aat.internal', description: 'The refunds URL you want to run these tests against'),
string(name: 'CCPAY_BULK_SCANNING_API_URL', defaultValue: 'http://ccpay-bulkscanning-api-aat.service.core-compute-aat.internal', description: 'The bulkscan URL you want to run these tests against'),
string(name: 'IDAM_API_URL', defaultValue: 'https://idam-api.aat.platform.hmcts.net', description: 'The Idam url you want to run these tests against'),
string(name: 'S2S_URL', defaultValue: 'http://rpe-service-auth-provider-aat.service.core-compute-aat.internal', description: 'The s2s url you want to run these tests against'),
string(name: 'REF_DATA_API_URL', defaultValue: 'http://rd-professional-api-aat.service.core-compute-aat.internal', description: 'The ref data url you want to run these tests against'),
string(name: 'OAUTH2_REDIRECT_URI', defaultValue: 'https://moneyclaims.aat.platform.hmcts.net', description: 'The redirect url you want to authenticate users and get idam token'),
string(name: 'SecurityRules',
defaultValue: 'http://raw.githubusercontent.com/hmcts/security-test-rules/master/conf/security-rules.conf',
description: 'SecurityUrl against which rules will be executed'),
])
])
@Library("Infrastructure")
def type = "java"
def product = "payment"
def component = "api"
def secrets = [
"ccpay-${params.ENVIRONMENT}": [
secret('cmc-service-secret', 'S2S_SERVICE_SECRET'),
secret('paybubble-s2s-secret', 'PAYBUBBLE_S2S_SERVICE_SECRET'),
secret('citizen-oauth-client-secret', 'OAUTH2_CLIENT_SECRET'),
secret('freg-idam-generated-user-email-pattern', 'GENERATED_USER_EMAIL_PATTERN'),
secret('freg-idam-test-user-password', 'TEST_USER_PASSWORD'),
secret('gov-pay-keys-cmc', 'GOV_PAY_AUTH_KEY_CMC'),
secret('pci-pal-antenna-client-secret', 'PCI_PAL_ANTENNA_CLIENT_SECRET'),
secret('paybubble-idam-client-secret','IDAM_PAYBUBBLE_CLIENT_SECRET'),
secret('ref-data-professional-client-secret','IDAM_RD_PROFESSIONAL_CLIENT_SECRET'),
secret('probate-solicitor-username', 'PROBATE_SOLICITOR_USER'),
secret('probate-solicitor-password', 'PROBATE_SOLICITOR_PASSWORD')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
withNightlyPipeline("java", product, component) {
env.TEST_URL = params.URL_TO_TEST
env.REFUND_API_URL = params.REFUND_API_URL
env.CCPAY_BULK_SCANNING_API_URL = params.CCPAY_BULK_SCANNING_API_URL
env.IDAM_API_URL = params.IDAM_API_URL
env.S2S_URL = params.S2S_URL
env.REF_DATA_API_URL = params.REF_DATA_API_URL
env.OAUTH2_REDIRECT_URI = params.OAUTH2_REDIRECT_URI
loadVaultSecrets(secrets)
enableSecurityScan()
enableMutationTest()
enableFortifyScan('ccpay-aat')
enableFullFunctionalTest()
enableSlackNotifications('#fee-pay-nightly-pipeline')
afterAlways('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
afterAlways('test') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "api/build/reports/checkstyle",
reportFiles : "main.html",
reportName : "CCPAY Payment App PREVIEW Application Checkstyle Main Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "api/build/reports/checkstyle",
reportFiles : "test.html",
reportName : "CCPAY Payment App PREVIEW Test Checkstyle Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "api/build/reports/checkstyle",
reportFiles : "aat.html",
reportName : "CCPAY Payment App AAT Application Checkstyle AAT Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "api/build/reports/tests/test",
reportFiles : "index.html",
reportName : "CCPAY Payment App PREVIEW Unit Tests Report"
]
}
afterAlways('fullFunctionalTest') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "api/target/site/serenity",
reportFiles : "index.html",
reportName : "CCPAY Payment App Serenity Functional Tests"
]
}
}