kibana/.ci/Jenkinsfile_coverage

61 lines
2 KiB
Plaintext
Raw Normal View History

#!/bin/groovy
library 'kibana-pipeline-library'
kibanaLibrary.load() // load from the Jenkins instance
kibanaPipeline(timeoutMinutes: 300) {
2020-03-02 21:04:27 +01:00
catchErrors {
2020-05-13 23:09:42 +02:00
def timestamp = new Date(currentBuild.startTimeInMillis).format("yyyy-MM-dd'T'HH:mm:ss'Z'", TimeZone.getTimeZone("UTC"))
2020-03-02 21:04:27 +01:00
withEnv([
2020-05-13 23:09:42 +02:00
"TIME_STAMP=${timestamp}",
'CODE_COVERAGE=1', // Enables coverage. Needed for multiple ci scripts, such as remote.ts, test/scripts/*.sh, schema.js, etc.
2020-03-02 21:04:27 +01:00
]) {
workers.base(name: 'coverage-worker', size: 'xl', ramDisk: false, bootstrapped: false) {
2020-06-05 18:49:06 +02:00
catchError {
kibanaPipeline.bash("""
echo '${TIME_STAMP}'
""", "### Print Canonical Time Stamp")
2020-06-05 18:49:06 +02:00
kibanaCoverage.runTests()
handleIngestion(TIME_STAMP)
}
handleFail()
}
}
2020-05-13 23:09:42 +02:00
kibanaPipeline.sendMail()
}
}
2020-05-13 23:09:42 +02:00
def handleIngestion(timestamp) {
def previousSha = handlePreviousSha()
2020-05-13 23:09:42 +02:00
kibanaPipeline.downloadCoverageArtifacts()
kibanaCoverage.prokLinks("### Process HTML Links")
kibanaCoverage.collectVcsInfo("### Collect VCS Info")
kibanaCoverage.generateReports("### Merge coverage reports")
kibanaCoverage.uploadCombinedReports()
2020-05-13 23:09:42 +02:00
kibanaCoverage.uploadCoverageStaticSite(timestamp)
kibanaCoverage.ingest(env.JOB_NAME, BUILD_NUMBER, BUILD_URL, timestamp, previousSha, teamAssignmentsPath(), '### Generate Team Assignments && Ingest')
2020-05-13 23:09:42 +02:00
}
def handlePreviousSha() {
def previous = kibanaCoverage.downloadPrevious('### Download OLD Previous')
kibanaCoverage.uploadPrevious('### Upload NEW Previous')
return previous
}
2020-06-05 18:49:06 +02:00
def handleFail() {
def buildStatus = buildUtils.getBuildStatus()
if (params.NOTIFY_ON_FAILURE && buildStatus != 'SUCCESS' && buildStatus != 'ABORTED' && buildStatus != 'UNSTABLE') {
2020-06-05 18:49:06 +02:00
slackNotifications.sendFailedBuild(
channel: '#kibana-qa',
username: 'Kibana QA'
)
}
}
2020-05-13 23:09:42 +02:00
def teamAssignmentsPath() {
return 'src/dev/code_coverage/ingest_coverage/team_assignment/team_assignments.txt'
}