-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jenkinsfile_CNP
75 lines (61 loc) · 2.11 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
#!groovy
import uk.gov.hmcts.contino.AppPipelineDsl
@Library("Infrastructure")
import uk.gov.hmcts.contino.GradleBuilder
def type = "java"
def product = "rpe"
def component = "send-letter-service"
def channel = '#bsp-build-notices'
env.TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX = 'hmctspublic.azurecr.io/imported/'
secrets = [
's2s-${env}': [
secret('microservicekey-send-letter-tests', 'TEST_S2S_SECRET')
],
'rpe-send-letter-${env}': [
secret('ftp-user', 'TEST_FTP_USER'),
secret('ftp-private-key', 'TEST_FTP_PRIVATE_KEY'),
secret('ftp-public-key', 'TEST_FTP_PUBLIC_KEY'),
secret('xerox-ftp-hostname', 'TEST_FTP_HOSTNAME'),
secret('launch-darkly-sdk-key', 'LAUNCH_DARKLY_SDK_KEY'),
secret('launch-darkly-offline-mode', 'LAUNCH_DARKLY_OFFLINE_MODE')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
GradleBuilder builder = new GradleBuilder(this, product)
// Vars for Kubernetes
env.PACT_BROKER_FULL_URL = 'https://pact-broker.platform.hmcts.net'
env.PACT_BROKER_URL = "pact-broker.platform.hmcts.net"
env.PACT_BROKER_PORT = "443"
env.PACT_BROKER_SCHEME = "https"
withPipeline(type , product, component) {
afterSuccess('akschartsinstall'){
// vars needed for AKS testing
env.TEST_S2S_NAME = 'send_letter_tests'
env.TEST_S2S_URL = 'http://rpe-service-auth-provider-aat.service.core-compute-aat.internal'
env.TEST_FTP_PORT = 22
env.TEST_FTP_FINGERPRINT = 'SHA256:3tX3DIkqd1Loz2alHfnt+qjHocfxk0YUOZHlnf9Zgdk='
env.FTP_TARGET_FOLDER = 'TO_XEROX'
env.TEST_FTP_REPORTS_FOLDER = 'FROM_XEROX'
env.TEST_ENCRYPTION_ENABLED = true
}
afterSuccess('test') {
builder.gradle('integration')
}
enableDbMigration('rpe-send-letter')
enableSlackNotifications(channel)
enableAksStagingDeployment()
disableLegacyDeployment()
loadVaultSecrets(secrets)
onMaster() {
enablePactAs([AppPipelineDsl.PactRoles.PROVIDER])
}
def branchesToSync = ['demo', 'perftest', 'ithc']
syncBranchesWithMaster(branchesToSync)
}