-
Notifications
You must be signed in to change notification settings - Fork 6
/
Jenkinsfile_parameterized
56 lines (48 loc) · 1.6 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
#!groovy
properties([
[
$class: 'GithubProjectProperty',
displayName: 'Evidence Management CCD Orchestrator',
projectUrlStr: 'https://github.com/hmcts/rap-em-ccd-orchestrator'
],
pipelineTriggers([
[$class: 'GitHubPushTrigger']
]),
parameters([
choice(name: 'ENVIRONMENT', choices: 'saat\nsprod\nsandbox', description: 'Environment where code should be build and deployed')
]),
])
@Library("Infrastructure")
def type = "java"
def product = "em"
def component = "ccd-orchestrator"
def secrets = [
's2s-${env}': [
secret('microservicekey-em-gw', 'FUNCTIONAL_TEST_CLIENT_S2S_TOKEN')
],
'rpa-${env}': [
secret('show-oauth2-token', 'FUNCTIONAL_TEST_CLIENT_OAUTH_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, params.ENVIRONMENT, 'sandbox') {
enableDockerBuild()
overrideVaultEnvironments(vaultOverrides)
loadVaultSecrets(secrets)
afterAlways('functionalTest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
afterAlways('functionalTest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
}