generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile_CNP
104 lines (89 loc) · 3.65 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!groovy
properties(
[
[
$class : 'GithubProjectProperty',
projectUrlStr: 'https://github.com/hmcts/ccpay-notifications-service'
],
pipelineTriggers([[$class: 'GitHubPushTrigger']])
]
)
@Library("Infrastructure")
def type = "java"
def product = "ccpay"
def component = "notifications-service"
def secrets = [
'ccpay-${env}': [
secret('refunds-api-client-secret', 'REFUND_SERVICE_ACCOUNT_CLIENT_SECRET'),
secret('refunds-api-user-password', 'REFUND_SERVICE_ACCOUNT_PASSWORD'),
secret('notifications-s2s-secret', 'OIDC_S2S_SECRET'),
secret('paybubble-s2s-secret', 'S2S_SERVICE_SECRET_PAYBUBBLE'),
secret('freg-idam-generated-user-email-pattern', 'GENERATED_USER_EMAIL_PATTERN'),
secret('freg-idam-test-user-password', 'TEST_USER_PASSWORD'),
secret('notifications-letter-template-id', 'NOTIFICATION_LETTER_TEMPLATE_ID'),
secret('notifications-email-template-id', 'NOTIFICATION_EMAIL_TEMPLATE_ID'),
secret('paybubble-idam-client-secret','IDAM_PAYBUBBLE_CLIENT_SECRET'),
secret('notifications-letter-card-pba-template-id','NOTIFICATION_LETTER_CARD_PBA_TEMPLATE_ID'),
secret('notifications-email-card-pba-template-id','NOTIFICATION_EMAIL_CARD_PBA_TEMPLATE_ID'),
secret('notifications-letter-cheque-po-cash-template-id','NOTIFICATIONS_LETTER_CHEQUE_PO_CASH_TEMPLATE_ID'),
secret('notifications-email-cheque-po-cash-template-id','NOTIFICATIONS_EMAIL_CHEQUE_PO_CASH_TEMPLATE_ID'),
secret('notifications-letter-refund-when-contacted-template-id','NOTIFICATION_LETTER_REFUND_WHEN_CONTACTED_TEMPLATE_ID'),
secret('notifications-email-refund-when-contacted-template-id','NOTIFICATION_EMAIL_REFUND_WHEN_CONTACTED_TEMPLATE_ID'),
secret('postcode-address-lookup-id','POSTCODE_ADDRESS_LOOKUP_ID')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
def branchesToSync = ['demo', 'ithc', 'perftest']
withPipeline(type, product, component) {
loadVaultSecrets(secrets)
enableDbMigration('ccpay')
enableAksStagingDeployment()
afterAlways('test') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/test",
reportFiles : "index.html",
reportName : "CCPAY NOTIFICATIONS PREVIEW Unit Tests Report"
]
}
afterAlways('functionalTest:preview') {
publishHTML target: [
reportDir : "build/reports/tests/functional",
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportFiles : "index.html",
reportName : "CCPAY NOTIFICATIONS PREVIEW API Functional Test Report"
]
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "target/site/serenity/",
reportFiles : "index.html",
reportName : "CCPAY NOTIFICATIONS SERVICE PREVIEW API Functional Test Serenity Report"
]
}
afterAlways('functionalTest:aat') {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "target/site/serenity/",
reportFiles : "index.html",
reportName : "CCPAY NOTIFICATIONS SERVICE AAT Functional Tests Serenity Report"
]
}
disableLegacyDeployment()
//Sync demo,ithc and perftest with master branch
syncBranchesWithMaster(branchesToSync)
}