-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile_parameterized
58 lines (46 loc) · 1.67 KB
/
Jenkinsfile_parameterized
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
#!groovy
@Library("Infrastructure") _
properties([
parameters([
string(name: 'PRODUCT_NAME', defaultValue: 'rd', description: ''),
string(name: 'APP', defaultValue: 'judicial-data-load', description: 'judicial Reference Data API'),
string(name: 'TYPE', defaultValue: 'java', description: ''),
string(name: 'ENVIRONMENT', defaultValue: 'sandbox', description: 'Environment where code should be build and deployed'),
choice(name: 'SUBSCRIPTION', choices: 'sandbox\nnonprod\nprod', description: 'Azure subscriptions available to build in')
])
])
String type = "java"
String product = "rd"
String component = "judicial-data-load"
def secrets = [
's2s-${env}': [
secret('microservicekey-rd-judicial-data-load', 'S2S_SECRET')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
def vaultOverrides = [
'preview' : 'aat',
'spreview': 'saat'
]
withParameterizedPipeline(type, product, component, 'sandbox', 'sandbox') {
overrideVaultEnvironments(vaultOverrides)
setVaultName('rd')
loadVaultSecrets(secrets)
enableDbMigration()
enableDockerBuild()
// Var for testcontainers.org
env.TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX = "hmctspublic.azurecr.io/imported/"
afterSuccess('functionalTest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
afterSuccess('functionalTest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
}