-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile_CNP
121 lines (102 loc) · 3.67 KB
/
Jenkinsfile_CNP
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
#!groovy
properties([
[$class: 'GithubProjectProperty', projectUrlStr: 'https://github.com/hmcts/sscs-case-loader.git'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])
])
@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)
def branchesToSync = ['demo', 'ithc', 'perftest']
withPipeline(type, product, component) {
loadVaultSecrets(secrets)
enableSlackNotifications('#sscs-tech')
if ("demo" != "${env.BRANCH_NAME}") {
enableAksStagingDeployment()
disableLegacyDeployment()
}
nonServiceApp()
syncBranchesWithMaster(branchesToSync)
afterAlways('test') {
builder.gradle('jacocoTestReport')
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/checkstyle",
reportFiles : "main.html",
reportName : "Checkstyle Main Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/checkstyle",
reportFiles : "test.html",
reportName : "Checkstyle Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/checkstyle",
reportFiles : "functionalTest.html",
reportName : "Checkstyle Functional Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/checkstyle",
reportFiles : "integrationTest.html",
reportName : "Checkstyle Integration Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/test",
reportFiles : "index.html",
reportName : "Unit Tests Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/pmd",
reportFiles : "main.html",
reportName : "PMD Report"
]
}
}