-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathJenkinsfile_nightly
96 lines (79 loc) · 3.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!groovy
properties([
// H allow predefined but random minute see https://en.wikipedia.org/wiki/Cron#Non-standard_characters
//CCD-3539 (Stop running Nightly builds on weekends). Original schedule was 'H 05 * * *'
pipelineTriggers([cron('H 07 * * 1-5')])
])
@Library("Infrastructure")
def type = "java"
def product = "ccd"
def component = "definition-store-api"
def secrets = [
'ccd-${env}': [
secret('ccd-caseworker-autotest-email', 'CCD_CASEWORKER_AUTOTEST_EMAIL'),
secret('ccd-caseworker-autotest-password', 'CCD_CASEWORKER_AUTOTEST_PASSWORD'),
secret('ccd-befta-caseworker-3-pwd', 'CCD_BEFTA_CASEWORKER_3_PWD'),
secret('ccd-befta-master-caseworker-pwd', 'CCD_BEFTA_MASTER_CASEWORKER_PWD'),
secret('ccd-api-gateway-oauth2-client-secret', 'CCD_API_GATEWAY_OAUTH2_CLIENT_SECRET'),
secret('definition-importer-username', 'DEFINITION_IMPORTER_USERNAME'),
secret('definition-importer-password', 'DEFINITION_IMPORTER_PASSWORD')
],
's2s-${env}': [
secret('microservicekey-ccd-gw', 'CCD_API_GATEWAY_S2S_KEY'),
secret('microservicekey-ccd-gw', 'BEFTA_S2S_CLIENT_SECRET')
]
]
static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[
$class: 'AzureKeyVaultSecret',
secretType: 'Secret',
name: secretName,
version: '',
envVariable: envVar
]
}
def vaultOverrides = [
'preview': 'aat',
'spreview': 'saat'
]
// Vars needed for AKS functional and smoke tests
env.TEST_URL = "http://ccd-definition-store-api-aat.service.core-compute-aat.internal"
env.BEFTA_S2S_CLIENT_ID = "ccd_gw"
env.CCD_CASEWORKER_AUTOTEST_EMAIL = "auto.test.cnp@gmail.com"
env.BEFTA_RESPONSE_HEADER_CHECK_POLICY="JUST_WARN"
env.CCD_STUB_SERVICE_URI_BASE="ccd-test-stubs-service-aat.service.core-compute-aat.internal"
// BEFTA retry env variables
env.BEFTA_RETRY_MAX_ATTEMPTS = "3"
env.BEFTA_RETRY_STATUS_CODES = "500,502,503,504"
env.BEFTA_RETRY_MAX_DELAY = "1000"
env.BEFTA_RETRY_NON_RETRYABLE_HTTP_METHODS = "PUT,POST"
env.DEFAULT_COLLECTION_ASSERTION_MODE="UNORDERED"
// Prevent Docker hub rate limit errors by ensuring that testcontainers uses images from hmctspublic ACR
env.TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX = "hmctspublic.azurecr.io/imported/"
// Prevent Docker hub rate limit errors by ensuring that testcontainers uses images from hmctspublic ACR
env.TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX = "hmctspublic.azurecr.io/imported/"
withNightlyPipeline(type, product, component) {
// Vars needed for functional and smoke tests run against AKS
env.OAUTH2_CLIENT_ID = "ccd_gateway"
env.OAUTH2_REDIRECT_URI = "https://www-ccd.nonprod.platform.hmcts.net/oauth2redirect"
env.IDAM_URL = "https://idam-api.aat.platform.hmcts.net"
env.S2S_URL = "http://rpe-service-auth-provider-aat.service.aat.platform.hmcts.net"
env.CCD_GW_SERVICE_NAME = "ccd_gw"
loadVaultSecrets(secrets)
enableFortifyScan()
enableDbMigration('ccd')
disableLegacyDeployment()
enableHighLevelDataSetup()
afterAlways('fortify-scan') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/Fortify Scan/**/*'
}
afterAlways('test') {
// hmcts/cnp-jenkins-library may fail to copy artifacts after checkstyle error so repeat command (see /src/uk/gov/hmcts/contino/GradleBuilder.groovy)
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/reports/checkstyle/*.html'
}
enableFullFunctionalTest(200)
afterAlways('fullFunctionalTest') {
steps.archiveArtifacts allowEmptyArchive: true, artifacts: '**/BEFTA Report for Functional Tests/**/*'
}
enableSlackNotifications('#ccd-nightly-builds')
}