-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile_CNP
83 lines (70 loc) · 2.67 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
@Library("Infrastructure")
import uk.gov.hmcts.contino.AppPipelineDsl
env.NO_SKIP_IMG_BUILD = 'true'
def type = "java"
def product = "idam"
def component = "testing-support-api"
def expiresAfter = "3000-01-01"
def branchesToSync = ['demo', 'perftest', 'ithc', 'preview']
def secrets = [
'idam-idam-${env}': [
secret('idam-functional-test-service-client-secret', 'TESTING_SERVICE_CLIENT_SECRET')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
// docs:
// 1. https://github.com/hmcts/cnp-jenkins-library
// 2. https://hmcts.github.io/ways-of-working/common-pipeline/common-pipeline.html#common-pipeline
withPipeline(type, product, component) {
enableSlackNotifications('#idam_tech')
enableAksStagingDeployment()
disableLegacyDeployment()
// syncBranchesWithMaster(branchesToSync)
expires(expiresAfter)
loadVaultSecrets(secrets)
before('functionalTest:preview') {
env.PUBLIC_URL = 'https://idam-web-public.aat.platform.hmcts.net'
env.TESTING_SUPPORT_API_URL = 'https://idam-testing-support-api.aat.platform.hmcts.net'
env.TESTING_SERVICE_CLIENT = 'idam-functional-test-service'
println """\
Using PREVIEW_ENVIRONMENT_NAME: ${env.PREVIEW_ENVIRONMENT_NAME}
Using NONPROD_ENVIRONMENT_NAME: ${env.NONPROD_ENVIRONMENT_NAME}
Using PUBLIC_URL: ${env.PUBLIC_URL}""".stripIndent()
}
before('functionalTest:aat') {
env.PUBLIC_URL = 'https://idam-web-public.aat.platform.hmcts.net'
env.TESTING_SUPPORT_API_URL = 'https://idam-testing-support-api.aat.platform.hmcts.net'
env.TESTING_SERVICE_CLIENT = 'idam-functional-test-service'
println """\
Using NONPROD_ENVIRONMENT_NAME: ${env.NONPROD_ENVIRONMENT_NAME}
Using TESTING_SUPPORT_API_URL: ${env.TESTING_SUPPORT_API_URL}""".stripIndent()
}
afterAlways('functionalTest:preview') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/serenity/functional",
reportFiles : "index.html",
reportName : "IdAM Testing Support Functional Test Report"
]
}
afterAlways('functionalTest:aat') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/serenity/functional",
reportFiles : "index.html",
reportName : "IdAM Testing Support Functional Test Report"
]
}
}