-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathJenkinsfile_CNP
60 lines (48 loc) · 1.58 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
#!groovy
import uk.gov.hmcts.contino.GithubAPI
@Library("Infrastructure")
def type = "nodejs"
def product = "pcq"
def component = "frontend"
def branchesToSync = ['demo','ithc', 'perftest']
def secrets = [
'pcq-${env}': [
secret('probate-token-key', 'PROBATE_TOKEN_KEY')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
withPipeline(type, product, component) {
afterAlways('build') {
sh 'yarn setup'
}
before('smoketest:preview') {
sh 'rm -rf /home/jenkinsssh/.cache/ms-playwright && yarn install && yarn playwright install'
}
before('smoketest:aat') {
sh 'rm -rf /home/jenkinsssh/.cache/ms-playwright && yarn install && yarn playwright install'
}
enableAksStagingDeployment()
disableLegacyDeployment()
loadVaultSecrets(secrets)
// enableSlackNotifications('#pcq-builds')
syncBranchesWithMaster(branchesToSync)
afterAlways('functionalTest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'smoke-output/**/*'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*'
}
before('functionalTest:preview') {
//This is to force the loading of preview.yaml instead of testing.yaml in PRs
env.NODE_CONFIG_ENV = 'preview'
}
afterAlways('functionalTest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'smoke-output/**/*'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*'
}
}