-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile_CNP
87 lines (70 loc) · 3.12 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
#!groovy
import uk.gov.hmcts.contino.AppPipelineDsl
properties([
[$class: 'GithubProjectProperty', projectUrlStr: 'https://github.com/hmcts/div-case-orchestration-service.git'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])
])
@Library("Infrastructure")
def type = "java"
def product = "div"
def component = "cos"
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
def secrets = [
'div-${env}': [
secret("ccd-submission-s2s-auth-secret", "AUTH_PROVIDER_CCDSUBMISSION_CLIENT_KEY"),
secret("div-doc-s2s-auth-secret", "AUTH_PROVIDER_DOCUMENTGENERATOR_CLIENT_KEY"),
secret("frontend-secret", "SERVICE_AUTH_SECRET"),
secret("idam-secret", "IDAM_CLIENT_SECRET"),
secret("idam-xui-secret", "IDAM_XUI_CLIENT_SECRET"),
secret("idam-citizen-username", "IDAM_CITIZEN_USERNAME"),
secret("idam-citizen-password", "IDAM_CITIZEN_PASSWORD"),
secret("idam-caseworker-username", "IDAM_CASEWORKER_USERNAME"),
secret("idam-caseworker-password", "IDAM_CASEWORKER_PASSWORD"),
secret("cos-POSTGRES-PASS-V14", "DIV_SCHEDULER_DB_PASSWORD"),
secret("uk-gov-notify-api-key", "UK_GOV_NOTIFY_API_KEY"),
secret("AppInsightsInstrumentationKey", "azure.application-insights.instrumentation-key"),
secret("idam-caseworker-superuser-username", "IDAM_CASEWORKER_SUPERUSER_USERNAME"),
secret("idam-caseworker-superuser-password", "IDAM_CASEWORKER_SUPERUSER_PASSWORD")
]
]
// Vars for Kubernetes
env.PACT_BROKER_FULL_URL = 'https://pact-broker.platform.hmcts.net'
withPipeline(type, product, component) {
if (env.CHANGE_TITLE && !env.CHANGE_TITLE.startsWith('[PREVIEW]')) {
enableDbMigration('div')
}
loadVaultSecrets(secrets)
enableAksStagingDeployment()
disableLegacyDeployment()
afterSuccess('checkout') {
echo 'divorce-case-orchestration-service checked out'
}
afterSuccess('test') {
steps.junit '**/test-results/**/*.xml'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'build/reports/**/*'
}
before('functionalTest:aat') {
env.test_environment = 'aat'
}
afterSuccess('functionalTest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'build/reports/**/*'
}
// Kubernetes does not retrieve variables from the output terraform
before('functionalTest:preview') {
env.FEATURE_RESP_SOLICITOR_DETAILS = 'true'
env.test_environment = 'aat'
}
afterSuccess('functionalTest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'build/reports/**/*'
}
enablePactAs([AppPipelineDsl.PactRoles.CONSUMER])
}