forked from hmcts/sptribs-case-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile_nightly
88 lines (75 loc) · 2.66 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
80
81
82
83
84
85
86
87
88
properties([
// H allow predefined but random minute see https://en.wikipedia.org/wiki/Cron#Non-standard_characters
pipelineTriggers([cron('H 8 * * 1-5')]),
parameters([
string(name: 'URL_TO_TEST', defaultValue: 'http://sptribs-case-api-aat.service.core-compute-aat.internal', description: 'The URL you want to run these tests against'),
string(name: 'SecurityRules',
defaultValue: 'http://raw.githubusercontent.com/hmcts/security-test-rules/master/conf/security-rules.conf',
description: 'The URL you want to run these tests against'),
])
])
@Library("Infrastructure")
import uk.gov.hmcts.contino.GradleBuilder
def type = "java"
def product = "sptribs"
def component = "case-api"
GradleBuilder builder = new GradleBuilder(this, product)
static Map<String, Object> secret(String secretName, String envVariable) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
name : secretName,
envVariable: envVariable
]
}
def secrets = [
'sptribs-${env}' :[
secret('idam-secret', 'OAUTH2_CLIENT_SECRET'),
secret('idam-solicitor-username', 'IDAM_SOLICITOR_USERNAME'),
secret('idam-solicitor-password', 'IDAM_SOLICITOR_PASSWORD')
]
]
withNightlyPipeline(type, product, component) {
env.TEST_URL = "http://sptribs-case-api-aat.service.core-compute-aat.internal"
loadVaultSecrets(secrets)
enableSlackNotifications('#special-tribunals-builds')
enableFortifyScan()
enableFullFunctionalTest()
afterAlways('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
afterAlways('fullFunctionalTest') {
archiveArtifacts allowEmptyArchive: true, artifacts: 'output/**/*'
}
afterSuccess('fullFunctionalTest') {
Exception ex = null;
try {
builder.gradle('e2eTestsNightlyFirefox')
} catch (Exception caught) {
ex = caught;
} finally {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/e2eTestsNightlyFirefox",
reportFiles : "index.html",
reportName : "E2E Tests Report Firefox"
]
try {
builder.gradle('e2eTestsNightlyMsEdge')
} finally {
publishHTML target: [
allowMissing : true,
alwaysLinkToLastBuild: true,
keepAll : true,
reportDir : "build/reports/tests/e2eTestsNightlyMsEdge",
reportFiles : "index.html",
reportName : "E2E Tests Report MS Edge"
]
if (ex != null) {
throw ex;
}
}
}
}
}