This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile_CNP
115 lines (94 loc) · 3.38 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
#!groovy
@Library("Infrastructure")
import uk.gov.hmcts.contino.AppPipelineDsl
def type = "java"
def product = "rd"
def component = "profile-sync"
def secrets = [
's2s-${env}': [
secret('microservicekey-rd-professional-api', 'S2S_SECRET')
],
'rd-${env}': [
secret('OAUTH2-CLIENT-SECRET', 'OAUTH2_CLIENT_SECRET'),
secret('idam-rd-system-user-username', 'RD_SYSTEM_USER_USERNAME'),
secret('idam-rd-system-user-password', 'RD_SYSTEM_USER_PASSWORD')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
def vaultOverrides = [
'preview' : 'aat',
'spreview': 'saat'
]
// Configure branches to sync with master branch
def branchesToSync = ['demo', 'ithc', 'perftest']
// Var for testcontainers.org
env.TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX = "hmctspublic.azurecr.io/imported/"
withPipeline(type, product, component) {
overrideVaultEnvironments(vaultOverrides)
loadVaultSecrets(secrets)
disableLegacyDeployment()
env.S2S_URL_FOR_TESTS = "http://rpe-service-auth-provider-aat.service.core-compute-aat.internal"
enableAksStagingDeployment()
before('functionalTest:preview') {
env.TEST_URL = "http://rd-profile-sync-preview.preview.hmcts.platform.net"
}
before('functionalTest:aat') {
env.TEST_URL = "http://rd-profile-sync-aat.aat.hmcts.platform.net"
}
before('smoketest:preview') {
env.TEST_URL = "http://rd-profile-sync-preview.preview.platform.hmcts.net"
}
before('smoketest:aat') {
env.TEST_URL = "http://rd-profile-sync-aat.aat.platform.hmcts.net"
}
// Sync demo and perftest with master branch
syncBranchesWithMaster(branchesToSync)
afterSuccess('sonarscan') {
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/tests/integration",
reportFiles : "index.html",
reportName : "Integration Test Report"
]
}
afterSuccess('smoketest:preview') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/smoke",
reportFiles : "index.html",
reportName : "Smoke Test Report"
]
}
afterSuccess('smoketest:aat') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/smoke",
reportFiles : "index.html",
reportName : "Smoke Test Report"
]
}
enablePactAs([
AppPipelineDsl.PactRoles.CONSUMER
])
}