-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile_nightly
73 lines (60 loc) · 2.44 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
#!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://sscs-case-loader-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")
import uk.gov.hmcts.contino.GradleBuilder
def type = "java"
def product = "sscs"
def component = "case-loader"
def secrets = [
'sscs-${env}': [
secret('sftp-host', 'GAPS2_SFTP_HOST'),
secret('sftp-port', 'GAPS2_SFTP_PORT'),
secret('gaps2-service-sftp-private-key', 'GAPS2_KEY_LOCATION'),
secret('sftp-user', 'GAPS2_SFTP_USER'),
secret('sftp-dir', 'GAPS2_SFTP_DIR'),
secret('ccd-api', 'CORE_CASE_DATA_API_URL'),
secret('ccd-jid', 'CORE_CASE_DATA_JURISDICTION_ID'),
secret('ccd-tid', 'CORE_CASE_DATA_CASE_TYPE_ID'),
secret('idam-api', 'IDAM_URL'),
secret('idam-s2s-api', 'IDAM_S2S_AUTH'),
secret('sscs-s2s-secret', 'IDAM_S2S_AUTH_TOTP_SECRET'),
secret('s2s-micro', 'IDAM_S2S_AUTH_MICROSERVICE'),
secret('idam-sscs-systemupdate-user', 'IDAM_SSCS_SYSTEMUPDATE_USER'),
secret('idam-sscs-systemupdate-password', 'IDAM_SSCS_SYSTEMUPDATE_PASSWORD'),
secret('idam-sscs-oauth2-client-secret', 'IDAM_OAUTH2_CLIENT_SECRET'),
secret('idam-oauth-user', 'IDAM_OAUTH2_CLIENT_ID'),
secret('idam-redirect', 'IDAM_OAUTH2_REDIRECT_URL'),
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
GradleBuilder builder = new GradleBuilder(this, product)
withNightlyPipeline(type, product, component) {
env.TEST_URL = params.URL_TO_TEST
env.Rules = params.SecurityRules
enableSecurityScan()
loadVaultSecrets(secrets)
enableFortifyScan()
enableAksStagingDeployment()
disableLegacyDeployment()
nonServiceApp()
afterSuccess('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
enableSlackNotifications('#sscs-tech')
}