-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile_CNP
88 lines (69 loc) · 2.46 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
85
86
87
88
#!groovy
import uk.gov.hmcts.contino.AppPipelineDsl
properties(
[[$class: 'GithubProjectProperty', projectUrlStr: 'https://github.com/hmcts/fees-register-app.git'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])]
)
@Library('Infrastructure')
def type = "java"
def product = "fees-register"
def app = "api"
// Configure branches to sync with master branch
def branchesToSync = ['demo', 'ithc', 'perftest']
env.PACT_BROKER_URL = 'https://pact-broker.platform.hmcts.net'
List<LinkedHashMap<String, Object>> secrets1 = [
secret('freg-idam-test-user-password', 'TEST_USER_PASSWORD'),
secret('freg-idam-generated-user-email-pattern', 'GENERATED_USER_EMAIL_PATTERN'),
secret('freg-idam-client-secret', 'OAUTH2_CLIENT_SECRET')
]
def vaultOverrides = [
'preview': 'aat',
'hmctsdemo': 'aat',
]
def secrets = [
'ccpay-${env}': [
secret('freg-idam-test-user-password', 'TEST_USER_PASSWORD'),
secret('freg-idam-generated-user-email-pattern', 'GENERATED_USER_EMAIL_PATTERN'),
secret('freg-idam-client-secret', 'OAUTH2_CLIENT_SECRET')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
withPipeline(type, product, app) {
overrideVaultEnvironments(vaultOverrides)
loadVaultSecrets(secrets)
enableDbMigration('fees-register')
enableAksStagingDeployment()
afterAlways('functionalTest:aat') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "api/target/site/serenity",
reportFiles : "index.html",
reportName : "AAT Serenity Functional Report"
]
}
afterAlways('functionalTest:preview') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "api/target/site/serenity/",
reportFiles : "index.html",
reportName : "Preview Serenity Functional Report"
]
}
disableLegacyDeployment()
onMaster() {
enablePactAs([AppPipelineDsl.PactRoles.PROVIDER])
}
//Sync demo,ithc and perftest with master branch
syncBranchesWithMaster(branchesToSync)
}