generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile_nightly
79 lines (68 loc) · 2.64 KB
/
Jenkinsfile_nightly
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
#!groovy
properties([
// H allow predefined but random minute see https://en.wikipedia.org/wiki/Cron#Non-standard_characters
pipelineTriggers([cron('H 07 * * 1-5')]),
parameters([
string(name: 'SecurityRules',
defaultValue: 'https://raw.githubusercontent.com/hmcts/security-test-rules/master/conf/security-rules.conf',
description: 'The URL you want to run these tests against'),
])
])
@Library("Infrastructure")
def type = "java"
def product = "disposer"
def component = "disposer-idam-user"
def secrets = [
'disposer-${env}': [
secret('app-insights-connection-string', 'app-insights-connection-string'),
secret('idam-client-secret', 'DISPOSER_IDAM_USER_CLIENT_SECRET'),
secret('s2s-secret-disposer-idam-user', 'S2S_SECRET_DISPOSER_IDAM_USER'),
secret('idam-citizen-disposer-system-user-username', 'IDAM_CLIENT_USERNAME'),
secret('idam-citizen-disposer-system-user-password', 'IDAM_CLIENT_PASSWORD')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
withNightlyPipeline(type, product, component) {
// Set required environment variables to run functional tests apart from one in vaults.
env.S2S_URL = 'http://rpe-service-auth-provider-aat.service.core-compute-aat.internal'
env.IDAM_API_URL = 'https://idam-api.aat.platform.hmcts.net'
env.ROLE_ASSIGNMENT_HOST = 'http://am-role-assignment-service-aat.service.core-compute-aat.internal'
env.LAU_API_URL = 'http://lau-idam-backend-aat.service.core-compute-aat.internal'
loadVaultSecrets(secrets)
enableAksStagingDeployment()
disableLegacyDeployment()
nonServiceApp()
enableMutationTest()
//enableFullFunctionalTest()
enableSlackNotifications('#disposer-builds')
enableFortifyScan()
afterAlways('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
afterAlways('mutationTest') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*'
}
afterAlways('securityScan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'functional-output/**/*'
}
before('fullFunctionalTest') {
// Execute functional tests
echo "Just waiting a while to ensure that the pod has run the job"
sh "sleep 30s"
echo "Verifying that functional test run correctly"
try {
builder.gradle('functional')
//builder.gradleWithOutput('functional')
} finally {
junit '**/test-results/**/*.xml'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'build/test-results/**'
}
}
}