-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile_nightly
74 lines (61 loc) · 2.84 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
#!groovy
properties([
pipelineTriggers([cron('H 8 * * 1-5')]),
parameters([
string(name: 'URL_TO_TEST', defaultValue: 'http://div-cos-aat.service.core-compute-aat.internal', description: 'The URL you want to run these tests against')
])
])
@Library("Infrastructure")
def type = "java"
def product = "div"
def component = "cos"
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[ $class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
def secrets = [
'div-${env}': [
secret("ccd-submission-s2s-auth-secret", "AUTH_PROVIDER_CCDSUBMISSION_CLIENT_KEY"),
secret("div-doc-s2s-auth-secret", "AUTH_PROVIDER_DOCUMENTGENERATOR_CLIENT_KEY"),
secret("frontend-secret", "SERVICE_AUTH_SECRET"),
secret("idam-secret", "IDAM_CLIENT_SECRET"),
secret("idam-xui-secret", "IDAM_XUI_CLIENT_SECRET"),
secret("idam-citizen-username", "IDAM_CITIZEN_USERNAME"),
secret("idam-citizen-password", "IDAM_CITIZEN_PASSWORD"),
secret("idam-caseworker-username", "IDAM_CASEWORKER_USERNAME"),
secret("idam-caseworker-password", "IDAM_CASEWORKER_PASSWORD"),
secret("cos-POSTGRES-PASS-V14", "DIV_SCHEDULER_DB_PASSWORD"),
secret("uk-gov-notify-api-key", "UK_GOV_NOTIFY_API_KEY"),
secret("AppInsightsInstrumentationKey", "azure.application-insights.instrumentation-key"),
secret("idam-caseworker-superuser-username", "IDAM_CASEWORKER_SUPERUSER_USERNAME"),
secret("idam-caseworker-superuser-password", "IDAM_CASEWORKER_SUPERUSER_PASSWORD")
]
]
withNightlyPipeline(type, product, component) {
env.TEST_URL = params.URL_TO_TEST
loadVaultSecrets(secrets)
println("### Set test_environment.. ###")
env.test_environment = 'aat'
afterSuccess('DependencyCheckNightly') {
stage('NightlyFunctional') {
println("~~~~~~~~~~~~~~~~~ Starting Nightly Only Functional :aat ~~~~~~~~~~")
sh("./gradlew --no-daemon --init-script init.gradle nightlyFunctional")
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'build/reports/**/*'
}
}
afterSuccess('fullFunctionalTest') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/site/serenity/**/*'
steps.archiveArtifacts allowEmptyArchive: true, artifacts: 'build/reports/**/*'
}
enableFullFunctionalTest()
enableMutationTest()
enableFortifyScan()
afterSuccess('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
}