-
Notifications
You must be signed in to change notification settings - Fork 3
/
Jenkinsfile_parameterized
86 lines (69 loc) · 3.99 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
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
#!groovy
@Library("Infrastructure") _
properties([
parameters([
string(name: 'PRODUCT_NAME', defaultValue: 'ia', description: ''),
string(name: 'APP', defaultValue: 'case-documents-api', description: 'Immigration & Asylum case documents 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')
]),
[$class: 'GithubProjectProperty', projectUrlStr: 'https://github.com/hmcts/ia-case-documents-api.git'],
pipelineTriggers([[$class: 'GitHubPushTrigger']])
])
def secrets = [
'ia-${env}': [
secret('test-caseofficer-username', 'TEST_CASEOFFICER_USERNAME'),
secret('test-caseofficer-password', 'TEST_CASEOFFICER_PASSWORD'),
secret('test-law-firm-a-username', 'TEST_LAW_FIRM_A_USERNAME'),
secret('test-law-firm-a-password', 'TEST_LAW_FIRM_A_PASSWORD'),
secret('test-citizen-username', 'TEST_CITIZEN_USERNAME'),
secret('test-citizen-password', 'TEST_CITIZEN_PASSWORD'),
secret('test-adminofficer-username', 'TEST_ADMINOFFICER_USERNAME'),
secret('test-adminofficer-password', 'TEST_ADMINOFFICER_PASSWORD'),
secret('test-judge-x-username', 'TEST_JUDGE_X_USERNAME'),
secret('test-judge-x-password', 'TEST_JUDGE_X_PASSWORD'),
secret('idam-client-id', 'IA_IDAM_CLIENT_ID'),
secret('idam-secret', 'IA_IDAM_SECRET'),
secret('s2s-secret', 'IA_S2S_SECRET'),
secret('s2s-microservice', 'IA_S2S_MICROSERVICE'),
secret('launch-darkly-sdk-key', 'LAUNCH_DARKLY_SDK_KEY'),
secret('ia-config-validator-secret', 'IA_CONFIG_VALIDATOR_SECRET'),
secret('app-insights-connection-string', 'app-insights-connection-string'),
secret('customer-services-telephone', 'IA_CUSTOMER_SERVICES_TELEPHONE'),
secret('customer-services-email', 'IA_CUSTOMER_SERVICES_EMAIL'),
secret('gov-call-charges-url', 'IA_BAIL_GOV_CALL_CHARGES_URL'),
secret('generic-docker-pact-broker-password', 'GENERIC_DOCKER_PACT_BROKER_YAML_PASS')
secret('test-homeoffice-lart-username', 'TEST_HOMEOFFICE_LART_USERNAME'),
secret('test-homeoffice-lart-password', 'TEST_HOMEOFFICE_LART_PASSWORD'),
secret('test-homeoffice-pou-username', 'TEST_HOMEOFFICE_POU_USERNAME'),
secret('test-homeoffice-pou-password', 'TEST_HOMEOFFICE_POU_PASSWORD')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
version : '',
envVariable: envVar
]
}
withParameterizedPipeline(params.TYPE, params.PRODUCT_NAME, params.APP, params.ENVIRONMENT, params.SUBSCRIPTION) {
env.DOCMOSIS_ENDPOINT = "https://docmosis-development.platform.hmcts.net"
env.IA_IDAM_REDIRECT_URI = "https://ia-case-api-aat.service.core-compute-aat.internal/oauth2/callback"
env.DM_URL = "http://dm-store-aat.service.core-compute-aat.internal"
env.CCD_GW_URL = "http://dm-store-aat.service.core-compute-aat.internal"
env.IDAM_URL = "https://idam-api.aat.platform.hmcts.net"
env.CASE_DOCUMENT_AM_URL = "http://ccd-case-document-am-api-aat.service.core-compute-aat.internal"
env.S2S_URL = "http://rpe-service-auth-provider-aat.service.core-compute-aat.internal"
env.EM_BUNDLER_URL = "http://em-ccd-orchestrator-aat.service.core-compute-aat.internal"
env.EM_BUNDLER_STITCH_URI = "/api/stitch-ccd-bundles"
env.OPEN_ID_IDAM_URL = "https://idam-web-public.aat.platform.hmcts.net"
loadVaultSecrets(secrets)
afterAlways('functionalTest:preview') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
afterAlways('functionalTest:aat') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
}
}