forked from hmcts/sptribs-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile_CNP
84 lines (68 loc) · 2.28 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
#!groovy
@Library("Infrastructure")
import uk.gov.hmcts.contino.AppPipelineConfig
def type = "nodejs"
def product = "sptribs"
def component = "frontend"
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
def secrets = [
'sptribs-${env}': [
secret('idam-ui-secret', 'IDAM_SECRET'),
secret('citizen-user', 'CITIZEN_USERNAME'),
secret('citizen-password', 'CITIZEN_PASSWORD'),
secret('specialTribunals-cic-pcq-token', 'PCQ_TOKEN'),
secret('s2s-secret-sptribs-frontend', 'SERVICE_AUTH_SECRET')
]
]
def yarnBuilder = new uk.gov.hmcts.contino.YarnBuilder(this)
def branchesToSync = ['demo', 'perftest', 'ithc']
def pipelineConf = new AppPipelineConfig()
pipelineConf.vaultSecrets = secrets
withPipeline(type, product, component) {
enableAksStagingDeployment()
disableLegacyDeployment()
syncBranchesWithMaster(branchesToSync)
loadVaultSecrets(secrets)
afterSuccess('build') {
yarnBuilder.yarn('build')
}
before('smoketest:preview') {
env.SPTRIBS_FRONTEND_URL = "https://sptribs-frontend-pr-${CHANGE_ID}.preview.platform.hmcts.net/?edgecaseType=CIC"
}
afterAlways('smoketest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'output/**/*'
}
before('smoketest:aat') {
env.SPTRIBS_FRONTEND_URL = "https://sptribs-frontend.aat.platform.hmcts.net/"
}
afterAlways('smoketest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'output/**/*'
}
afterAlways('smoketest:preview') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/smoke",
reportFiles : "index.html",
reportName : "Smoke Test Report"
]
}
afterAlways('smoketest:aat') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/smoke",
reportFiles : "index.html",
reportName : "Smoke Test Report"
]
}
}