generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile_CNP
67 lines (58 loc) · 1.54 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
#!groovy
@Library("Infrastructure")
import uk.gov.hmcts.contino.GradleBuilder
def type = "java"
def product = "pip"
def component = "account-management"
def kv = product + '-ss-kv'
GradleBuilder builder = new GradleBuilder(this, product)
def setupTestSecrets() {
def bootstap_env = env.ENV == "prod" || env.ENV == "demo" || env.ENV == "sbox" ? env.ENV : "stg"
azureKeyVault(
keyVaultURL: "https://pip-bootstrap-${bootstap_env}-kv.vault.azure.net/",
secrets: [
secret('app-pip-account-management-scope', 'APP_URI'),
secret('app-tenant', 'TENANT_ID'),
secret('app-pip-subscription-management-id', 'CLIENT_ID_FT'),
secret('app-pip-subscription-management-pwd', 'CLIENT_SECRET_FT'),
]) {
env.APP_URI = "${APP_URI}"
env.TENANT_ID = "${TENANT_ID}"
env.CLIENT_ID_FT = "${CLIENT_ID_FT}"
env.CLIENT_SECRET_FT = "${CLIENT_SECRET_FT}"
}
}
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
withPipeline(type, product, component) {
onMaster() {
env.ENV = 'stg'
}
onPR() {
env.ENV = 'dev'
}
onDemo {
env.ENV = 'demo'
}
onPerftest {
env.ENV = 'perftest'
}
onIthc {
env.ENV = 'ithc'
}
setupTestSecrets()
enableDbMigration(kv)
enableSlackNotifications('#pip-build-notices')
enableAksStagingDeployment()
disableLegacyDeployment()
enableApiGatewayTest()
afterAlways('test') {
builder.gradle('integration')
}
}