-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile_CNP
72 lines (59 loc) · 1.92 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
#!groovy
import uk.gov.hmcts.contino.GithubAPI
properties(
[[$class: 'GithubProjectProperty', projectUrlStr: 'https://github.com/hmcts/ccd-admin-web'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])]
)
@Library("Infrastructure")
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
def product = "ccd"
def component = "admin-web"
// Variables to switch pipeline logic and wiring per type of build
def adminWebDevelopPr = "PR-325" // This doesn't change frequently, but when it does, only change this value.
def secrets = [
'ccd-${env}': [
secret('ccd-admin-web-oauth2-client-secret', 'OAUTH2_CLIENT_SECRET'),
secret('storage-account-primary-connection-string', 'STORAGEACCOUNT_PRIMARY_CONNECTION_STRING'),
secret('storage-account-secondary-connection-string', 'STORAGEACCOUNT_SECONDARY_CONNECTION_STRING'),
],
's2s-${env}': [
secret('microservicekey-ccd-admin', 'IDAM_SERVICE_KEY'),
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
def vaultOverrides = [
'preview': 'aat',
'spreview': 'saat'
]
env.PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
withPipeline("nodejs", product, component) {
onMaster {
enableSlackNotifications('#ccd-master-builds')
}
if (env.BRANCH_NAME.equalsIgnoreCase(adminWebDevelopPr)) {
enableSlackNotifications('#ccd-develop-builds')
}
onDemo {
enableSlackNotifications('#ccd-demo-builds')
}
onPR {
enableSlackNotifications('#ccd-pr-builds')
}
enableAksStagingDeployment()
overrideVaultEnvironments(vaultOverrides)
loadVaultSecrets(secrets)
disableLegacyDeployment()
afterAlways('checkout') {
sh "yarn cache clean"
}
afterAlways('build') {
yarnBuilder.yarn('setup')
}
}