-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJenkinsfile_CNP
More file actions
116 lines (99 loc) · 4.11 KB
/
Jenkinsfile_CNP
File metadata and controls
116 lines (99 loc) · 4.11 KB
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
#!groovy
@Library("Infrastructure")
import uk.gov.hmcts.contino.GradleBuilder
properties([
[
$class: 'GithubProjectProperty',
displayName: 'Evidence Stitching API',
projectUrlStr: 'https://github.com/hmcts/rpa-em-stitching-api'
],
pipelineTriggers([
[$class: 'GitHubPushTrigger']
])
])
def type = "java"
def product = "em"
def component = "stitching"
def secrets = [
's2s-${env}': [
secret('microservicekey-em-gw', 'FUNCTIONAL_TEST_CLIENT_S2S_TOKEN'),
secret('microservicekey-ccd-gw', 'FUNCTIONAL_TEST_CCD_GW_SERVICE_SECRET'),
secret('microservicekey-xui-webapp', 'FUNCTIONAL_TEST_XUI_WEBAPP_SERVICE_SECRET')
],
'rpa-${env}': [
secret('show-oauth2-token', 'FUNCTIONAL_TEST_CLIENT_OAUTH_SECRET')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
// Vars for Kubernetes
env.IDAM_API_BASE_URI = 'https://idam-api.aat.platform.hmcts.net'
env.OPEN_ID_API_BASE_URI = 'https://idam-web-public.aat.platform.hmcts.net/o'
env.S2S_BASE_URI = 'http://rpe-service-auth-provider-aat.service.core-compute-aat.internal'
env.IDAM_WEBSHOW_WHITELIST = 'https://em-show-aat.service.core-compute-aat.internal/oauth2/callback'
env.DM_STORE_APP_URL = 'http://dm-store-aat.service.core-compute-aat.internal'
env.CCD_DEF_API = 'http://ccd-definition-store-api-aat.service.core-compute-aat.internal'
env.CCD_DATA_API = 'http://ccd-data-store-api-aat.service.core-compute-aat.internal'
env.CDAM_URL = 'http://ccd-case-document-am-api-aat.service.core-compute-aat.internal'
env.DOCMOSIS_ENDPOINT = 'https://docmosis.aat.platform.hmcts.net/rs/convert'
env.TEST_USER_PASSWORD = 'S!' + UUID.randomUUID().toString().replace('-', '').take(20)
def vaultOverrides = [
'preview' : 'aat',
'spreview': 'saat'
]
GradleBuilder builder = new GradleBuilder(this, product)
withPipeline(type , product, component) {
enableDbMigration('em-stitching')
overrideVaultEnvironments(vaultOverrides)
loadVaultSecrets(secrets)
enableAksStagingDeployment()
disableLegacyDeployment()
onMaster {
afterSuccess('test') {
sh '''
curl https://raw.githubusercontent.com/hmcts/reform-api-docs/master/bin/publish-swagger-docs.sh > publish-swagger-docs.sh
sh ./publish-swagger-docs.sh
'''
}
enableFortifyScan('em-stitching-aat')
afterAlways('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
}
afterSuccess('securityScan') {
def time = "120"
echo "Waiting ${time} seconds for deployment to complete prior starting functional testing"
sleep time.toInteger() // seconds
try {
builder.gradle('functional')
} finally {
junit '**/test-results/**/*.xml'
}
}
afterAlways('test') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/tests/**/*'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/checkstyle/**/*'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/tests/integration/**/*'
}
afterAlways('smoketest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/tests/**/*'
}
afterAlways('smoketest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/tests/**/*'
}
afterAlways('functionalTest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/tests/**/*'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
afterAlways('functionalTest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/tests/**/*'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
syncBranchesWithMaster(['demo', 'perftest', 'ithc'])
}