forked from hmcts/pip-subscription-management
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile_CNP
More file actions
75 lines (64 loc) · 1.89 KB
/
Jenkinsfile_CNP
File metadata and controls
75 lines (64 loc) · 1.89 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
#!groovy
@Library("Infrastructure")
import uk.gov.hmcts.contino.GradleBuilder
def type = "java"
def product = "pip"
def component = "subscription-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-subscription-management-id', 'CLIENT_ID'),
secret('app-pip-subscription-management-pwd', 'CLIENT_SECRET'),
secret('app-pip-subscription-management-scope', 'APP_URI'),
secret('app-pip-data-management-scope', 'DATA_MANAGEMENT_AZ_API'),
secret('app-tenant', 'TENANT_ID'),
secret('app-pip-data-management-id', 'CLIENT_ID_FT'),
secret('app-pip-data-management-pwd', 'CLIENT_SECRET_FT'),
]) {
env.CLIENT_ID = "${CLIENT_ID}"
env.CLIENT_SECRET = "${CLIENT_SECRET}"
env.DATA_MANAGEMENT_AZ_API = "${DATA_MANAGEMENT_AZ_API}"
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')
}
}