-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathJenkinsfile_parameterized
77 lines (71 loc) · 2.73 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
#!groovy
//noinspection GroovyUnusedAssignment
@Library("Infrastructure") _
//noinspection GroovyAssignabilityCheck
properties([
parameters([
choice(name: 'ENVIRONMENT', choices: 'sandbox\nsaat\nsprod\nnonprod\nprod', description: 'Environment where code should be build and deployed')
])
])
def secrets = [
'probate-${env}': [
secret('testIdamBaseUrl', 'IDAM_API_URL'),
secret('testIdamLoginUrl', 'IDAM_LOGIN_URL'),
secret('testUseIdam', 'USE_IDAM'),
secret('testInviteIdListUrl', 'INVITE_ID_LIST_URL'),
secret('testPinUrl', 'PIN_URL'),
secret('testInvitationUrl', 'INVITATION_URL'),
secret('testIdamAddUserUrl', 'IDAM_ADD_USER_URL'),
secret('testIdamRole', 'IDAM_CITIZEN_ROLE'),
secret('testIdamUserGroup', 'IDAM_USER_GROUP'),
secret('testCitizenDomain', 'CITIZEN_EMAIL_DOMAIN'),
secret('testEnvEmailAddress', 'TEST_EMAIL_ADDRESS'),
secret('testEnvMobileNumber', 'TEST_MOBILE_NUMBER'),
secret('testTerms', 'TERMS_AND_CONDITIONS'),
secret('testSurvey', 'SURVEY'),
secret('testsurveyEndOfApplication', 'SURVEY_END_OF_APPLICATION'),
secret('testPostcodeServiceUrl', 'POSTCODE_SERVICE_URL'),
secret('testPostCodeAddressToken2', 'ADDRESS_TOKEN'),
secret('testRunE2ETest', 'RUN_E2E_TEST'),
secret('testValidationServiceUrl', 'VALIDATION_SERVICE_URL'),
secret('launchdarkly-key', 'LAUNCHDARKLY_KEY'),
secret('launchdarklyUserkeyFrontend', 'LAUNCHDARKLY_USER_KEY'),
secret('webchat-avaya-url', 'WEBCHAT_AVAYA_URL'),
secret('webchat-avaya-client-url', 'WEBCHAT_AVAYA_CLIENT_URL'),
secret('webchat-avaya-service', 'WEBCHAT_AVAYA_SERVICE'),
secret('AppInsightsInstrumentationKey', 'APPINSIGHTS_INSTRUMENTATIONKEY')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
String product = "probate"
String component = "frontend"
String slot = "sandbox"
String serviceName = "${product}-${component}-${env}"
String slotString = "-${slot}"
env.TEST_E2E_FRONTEND_URL = "${serviceName}${slotString}.service.core-compute-${params.ENVIRONMENT}.internal"
withParameterizedPipeline('nodejs', product, component, params.ENVIRONMENT, slot) {
afterSuccess('build') {
sh '''
yarn setup
printenv '''
}
loadVaultSecrets(secrets)
/*
afterSuccess('functionalTest:saat') {
sh "mkdir functional-output"
sh "cp -r output/mochawesome.* functional-output/."
publishHTML target: [
reportDir : "output/",
reportFiles : "mochawesome.html",
reportName : "SAAT Functional Tests",
alwaysLinkToLastBuild: true
]
} */
}