-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathJenkinsfile_CNP
More file actions
54 lines (43 loc) · 1.45 KB
/
Jenkinsfile_CNP
File metadata and controls
54 lines (43 loc) · 1.45 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
#!groovy
import uk.gov.hmcts.contino.GradleBuilder
@Library("Infrastructure")
def type = "java"
def product = "fact"
def component = "api"
GradleBuilder builder = new GradleBuilder(this, product)
def secrets = [
'fact-${env}': [
secret("oauth-client-secret", "OAUTH_SECRET"),
secret("oauth-user", "OAUTH_USER"),
secret("oauth-user-password", "OAUTH_USER_PASSWORD"),
secret("oauth-super-user", "OAUTH_SUPER_USER"),
secret("oauth-viewer-user", "OAUTH_VIEWER_USER"),
secret("mapit-key", "MAPIT_KEY")
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
def branchesToSync = ['demo', 'perftest', 'ithc']
// Prevent Docker hub rate limit errors by ensuring that testcontainers uses images from hmctsprod ACR
env.TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX = 'hmctsprod.azurecr.io/imported/'
withPipeline(type, product, component) {
disableLegacyDeployment()
loadVaultSecrets(secrets)
enableDbMigration('fact')
syncBranchesWithMaster(branchesToSync)
afterAlways('test') {
builder.gradle('integration')
}
afterAlways('functionalTest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/tests/**/*'
}
afterAlways('functionalTest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/tests/**/*'
}
}