generated from hmcts/expressjs-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile_CNP
98 lines (78 loc) · 3.11 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
87
88
89
90
91
92
93
94
95
96
97
98
#!groovy
@Library("Infrastructure")
import uk.gov.hmcts.contino.AppPipelineConfig
def type = "nodejs"
def product = "prl"
def component = "citizen-frontend"
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
def secrets = [
'prl-${env}': [
secret('AppInsightsInstrumentationKey', 'APP_INSIGHTS_INSTRUMENTATION_KEY'),
secret('prl-citizen-frontend-idam-client-secret', 'CITIZEN_IDAM_SECRET'),
secret('prl-cos-idam-client-secret', 'COS_API_IDAM_SECRET'),
secret('launchDarkly-sdk-key', 'LAUNCH_DARKLY_SDK_KEY'),
secret('postcode-lookup-token', 'POSTCODE_TOKEN'),
secret('citizen-upload-docs-email', 'UPLOAD_DOCUMENTS_EMAIL'),
secret('microservicekey-prl-citizen-frontend', 'SERVICE_AUTH_SECRET'),
secret('system-update-user-username', 'SYSTEM_UPDATE_USER_USERNAME'),
secret('system-update-user-password', 'SYSTEM_UPDATE_USER_PW'),
secret('citizen-user', 'CITIZEN_USERNAME'),
secret('citizen-password', 'CITIZEN_PW'),
secret('pact-broker-username', 'PACT_BROKER_YAML_USERNAME'),
secret('pact-broker-password', 'PACT_BROKER_YAML_PW'),
secret('prl-pcq-token-key', 'PCQ_TOKEN'),
secret('ccd-datastore-client-id', 'CCD_DATASTORE_client_id'),
secret('ccd-datastore-client-secret', 'CCD_DATASTORE_client_secret'),
secret('ccd-datastore-username', 'CCD_DATASTORE_username'),
secret('ccd-datastore-password', 'CCD_DATASTORE_password')
]
]
def pipelineConf = new AppPipelineConfig()
pipelineConf.vaultSecrets = secrets
env.IDAM_URL = 'https://idam-api.aat.platform.hmcts.net'
env.LAUNCH_DARKLY_OFFLINE_MODE = false
env.C100_REBUILD_FLAG = false
env.TESTING_SUPPORT_FLAG = false
env.ENABLE_CASE_TRAIN_TRACK = false
withPipeline(type, product, component) {
loadVaultSecrets(secrets)
enableAksStagingDeployment()
disableLegacyDeployment()
enableSlackNotifications('#prl-tech-notifications')
afterAlways('build') {
yarnBuilder.yarn('build')
}
before('smoketest:preview') {
env.PRL_CITIZEN_URL = "https://prl-citizen-frontend-pr-${CHANGE_ID}.preview.platform.hmcts.net/"
}
afterAlways('smoketest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'output/**/*'
}
before('smoketest:aat') {
env.PRL_CITIZEN_URL = "https://privatelaw.aat.platform.hmcts.net/"
}
afterAlways('smoketest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'output/**/*'
}
before('functionalTest:preview') {
env.PRL_CITIZEN_URL = "https://prl-citizen-frontend-pr-${CHANGE_ID}.preview.platform.hmcts.net/"
}
afterAlways('functionalTest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'output/**/*'
}
before('functionalTest:aat') {
env.PRL_CITIZEN_URL = "https://privatelaw.aat.platform.hmcts.net/"
yarnBuilder.yarn('test:functional:skip')
}
afterAlways('functionalTest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'output/**/*'
}
}