generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile_CNP
100 lines (78 loc) · 3.56 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
#!groovy
@Library("Infrastructure")
import uk.gov.hmcts.contino.GradleBuilder
import uk.gov.hmcts.contino.GithubAPI
def type = "java"
def product = "cpo"
def component = "case-payment-orders-api"
def branchesToSync = ['demo', 'ithc', 'perftest']
GradleBuilder builder = new GradleBuilder(this, product)
// Variables to switch pipeline logic and wiring per type of build
def definitionStoreDevelopPr = "PR-575" // This doesn't change frequently, but when it does, only change this value.
def secrets = [
'rpx-${env}': [
secret('mc-idam-client-secret', 'OAUTH2_CLIENT_SECRET')
],
'ccd-${env}': [
// BEFTA user: Common_User_For_Request
secret('ccd-caseworker-autotest-email', 'CCD_CASEWORKER_AUTOTEST_EMAIL'),
secret('ccd-caseworker-autotest-password', 'CCD_CASEWORKER_AUTOTEST_PASSWORD'),
secret('ccd-befta-caseworker-1-pwd', 'CCD_BEFTA_CASEWORKER_1_PWD')
],
's2s-${env}': [
secret('microservicekey-xui-webapp', 'BEFTA_S2S_CLIENT_SECRET'),
secret('microservicekey-payment-app', 'BEFTA_S2S_CLIENT_SECRET_OF_PAYMENT_APP')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
// :: configure `xuiwebapp` as the default value for `idamClientId`
env.OAUTH2_CLIENT_ID = "xuiwebapp"
env.OAUTH2_REDIRECT_URI = "https://manage-case.aat.platform.hmcts.net/oauth2/callback"
env.OAUTH2_ACCESS_TOKEN_TYPE = "OIDC"
env.OAUTH2_SCOPE_VARIABLES = "profile openid roles manage-user create-user"
// IDAM client and S2S auth
env.IDAM_API_URL_BASE = "https://idam-api.aat.platform.hmcts.net"
env.S2S_URL_BASE = "http://rpe-service-auth-provider-aat.service.core-compute-aat.internal"
env.CCD_API_GATEWAY_OAUTH2_CLIENT_ID = "ccd_gateway"
// :: configure `xui_webapp` as the default value for `s2sClientId`
env.BEFTA_S2S_CLIENT_ID = "xui_webapp"
env.BEFTA_S2S_CLIENT_ID_OF_PAYMENT_APP = "payment_app"
env.DEFAULT_COLLECTION_ASSERTION_MODE="UNORDERED"
env.BEFTA_RESPONSE_HEADER_CHECK_POLICY="JUST_WARN"
env.DEFINITION_STORE_URL_BASE = "https://ccd-definition-store-api-${definitionStoreDevelopPr}.preview.platform.hmcts.net".toLowerCase()
// Prevent Docker hub rate limit errors by ensuring that testcontainers uses images from hmctspublic ACR
env.TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX = "hmctspublic.azurecr.io/imported/"
withPipeline(type, product, component) {
onPR {
enableSlackNotifications('#ccd-pr-builds')
}
afterAlways('test') {
builder.gradle('integration')
// hmcts/cnp-jenkins-library may fail to copy artifacts after checkstyle error so repeat command (see /src/uk/gov/hmcts/contino/GradleBuilder.groovy)
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/checkstyle/*.html'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/pmd/*.html'
}
syncBranchesWithMaster(branchesToSync)
loadVaultSecrets(secrets)
enableAksStagingDeployment()
disableLegacyDeployment()
afterAlways('smoketest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/BEFTA Report for Smoke Tests/**/*'
}
afterAlways('smoketest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/BEFTA Report for Smoke Tests/**/*'
}
afterAlways('functionalTest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/BEFTA Report for Functional Tests/**/*'
}
afterAlways('functionalTest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/BEFTA Report for Functional Tests/**/*'
}
}