-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile_CNP
79 lines (64 loc) · 2.16 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
#!groovy
import uk.gov.hmcts.contino.AppPipelineDsl
properties([
[
$class: 'GithubProjectProperty',
displayName: 'Divorce Case Maintenance Service',
projectUrlStr: 'https://github.com/hmcts/div-case-maintenance-service'
],
pipelineTriggers([
[$class: 'GitHubPushTrigger']
])
])
@Library("Infrastructure")
def type = "java"
def product = "div"
def component = "cms"
def secrets = [
'div-${env}': [
secret("idam-secret", "AUTH_IDAM_CLIENT_SECRET"),
secret("ccd-submission-s2s-auth-secret", "AUTH_PROVIDER_SERVICE_CLIENT_KEY"),
secret("idam-secret", "AUTH2_CLIENT_SECRET"),
secret("draft-store-api-encryption-key", "DRAFT_STORE_API_ENCRYPTION_KEY_VALUE"),
secret("AppInsightsInstrumentationKey", "azure.application-insights.instrumentation-key"),
secret("idam-caseworker-username", "IDAM_CASEWORKER_USERNAME"),
secret("idam-caseworker-password", "IDAM_CASEWORKER_PASSWORD"),
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
// Vars for Kubernetes
env.PACT_BROKER_FULL_URL = 'https://pact-broker.platform.hmcts.net'
withPipeline(type , product, component) {
enableAksStagingDeployment()
loadVaultSecrets(secrets)
disableLegacyDeployment()
afterSuccess('checkout') {
echo '${product}-${component} checked out'
}
before('functionalTest:aat') {
env.test_environment = 'aat'
}
afterSuccess('functionalTest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
// Kubernetes does not retrieve variables from the output terraform
before('functionalTest:preview') {
env.test_environment = 'aat'
}
afterSuccess('functionalTest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
onMaster() {
enablePactAs([AppPipelineDsl.PactRoles.CONSUMER])
}
onPR() {
enablePactAs([AppPipelineDsl.PactRoles.CONSUMER])
}
}