forked from hmcts/sscs-cor-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile_CNP
83 lines (73 loc) · 2.87 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
#!groovy
properties(
[[$class: 'GithubProjectProperty', projectUrlStr: 'https://github.com/hmcts/sscs-cor-frontend'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])]
)
@Library("Infrastructure")
def product = "sscs-cor"
def component = "frontend"
def cohUrlAat = "http://coh-cor-aat.service.core-compute-aat.internal"
def sscsCorBackEndUrlAat = "http://sscs-tribunals-api-aat.service.core-compute-aat.internal"
def idamUrlAat = "https://idam-web-public.aat.platform.hmcts.net"
def idamApiUrlAat = "https://idam-api.aat.platform.hmcts.net"
def s2sUrlAat = "http://rpe-service-auth-provider-aat.service.core-compute-aat.internal"
def secrets = [
'sscs-${env}': [
secret('sscs-s2s-secret', 'S2S_SECRET'),
secret('idam-sscs-systemupdate-user', 'IDAM_SSCS_SYSTEMUPDATE_USER'),
secret('idam-sscs-systemupdate-password', 'IDAM_SSCS_SYSTEMUPDATE_PASSWORD'),
secret('idam-sscs-oauth2-client-secret', 'IDAM_OAUTH2_CLIENT_SECRET')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
def branchesToSync = ['demo', 'ithc', 'perftest']
withPipeline("nodejs", product, component) {
loadVaultSecrets(secrets)
after('checkout') {yarnBuilder.yarn('cache clean')}
after('build') {
yarnBuilder.yarn('build')
stage('Generate cookie banner') {
sh "./node_modules/gulp/bin/gulp.js default"
}
}
enableAksStagingDeployment()
disableLegacyDeployment()
syncBranchesWithMaster(branchesToSync)
before('securitychecks') { yarnBuilder.yarn('test:audit') }
before("functionalTest:preview") {
env.COH_URL = cohUrlAat
sh 'echo COH_URL=$COH_URL'
env.SSCS_API_URL = sscsCorBackEndUrlAat
sh 'echo SSCS_API_URL=$SSCS_API_URL'
env.IDAM_URL = idamUrlAat
sh 'echo IDAM_URL=$IDAM_URL'
env.IDAM_API_URL = idamApiUrlAat
sh 'echo IDAM_API_URL=$IDAM_API_URL'
env.S2S_URL = s2sUrlAat
sh 'echo S2S_URL=$S2S_URL'
env.S2S_OAUTH2_URL = "https://idam-api.aat.platform.hmcts.net"
sh 'echo S2S_OAUTH2_URL=$S2S_OAUTH2_URL'
}
before("functionalTest:aat") {
env.COH_URL = cohUrlAat
sh 'echo COH_URL=$COH_URL'
env.SSCS_API_URL = sscsCorBackEndUrlAat
sh 'echo SSCS_API_URL=$SSCS_API_URL'
env.IDAM_URL = idamUrlAat
sh 'echo IDAM_URL=$IDAM_URL'
env.IDAM_API_URL = idamApiUrlAat
sh 'echo IDAM_API_URL=$IDAM_API_URL'
env.S2S_URL = s2sUrlAat
sh 'echo S2S_URL=$S2S_URL'
env.S2S_OAUTH2_URL = "https://idam-api.aat.platform.hmcts.net"
sh 'echo S2S_OAUTH2_URL=$S2S_OAUTH2_URL'
}
}