2020-09-18 04:40:15 +02:00
|
|
|
def withPostBuildReporting(Map params, Closure closure) {
|
2020-01-27 23:10:34 +01:00
|
|
|
try {
|
|
|
|
closure()
|
|
|
|
} finally {
|
2020-08-04 19:13:51 +02:00
|
|
|
def parallelWorkspaces = []
|
|
|
|
try {
|
|
|
|
parallelWorkspaces = getParallelWorkspaces()
|
|
|
|
} catch(ex) {
|
|
|
|
print ex
|
2020-01-27 23:10:34 +01:00
|
|
|
}
|
|
|
|
|
2020-09-18 04:40:15 +02:00
|
|
|
if (params.runErrorReporter) {
|
|
|
|
catchErrors {
|
|
|
|
runErrorReporter([pwd()] + parallelWorkspaces)
|
|
|
|
}
|
2020-01-27 23:10:34 +01:00
|
|
|
}
|
|
|
|
|
2020-03-02 21:04:27 +01:00
|
|
|
catchErrors {
|
2020-01-27 23:10:34 +01:00
|
|
|
publishJunit()
|
|
|
|
}
|
2020-08-04 19:13:51 +02:00
|
|
|
|
|
|
|
catchErrors {
|
|
|
|
def parallelWorkspace = "${env.WORKSPACE}/parallel"
|
|
|
|
if (fileExists(parallelWorkspace)) {
|
|
|
|
dir(parallelWorkspace) {
|
|
|
|
def workspaceTasks = [:]
|
|
|
|
|
|
|
|
parallelWorkspaces.each { workspaceDir ->
|
|
|
|
workspaceTasks[workspaceDir] = {
|
|
|
|
dir(workspaceDir) {
|
|
|
|
catchErrors {
|
|
|
|
runbld.junit()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (workspaceTasks) {
|
|
|
|
parallel(workspaceTasks)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-01-27 23:10:34 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-04 19:13:51 +02:00
|
|
|
def getParallelWorkspaces() {
|
|
|
|
def workspaces = []
|
|
|
|
def parallelWorkspace = "${env.WORKSPACE}/parallel"
|
|
|
|
if (fileExists(parallelWorkspace)) {
|
|
|
|
dir(parallelWorkspace) {
|
|
|
|
// findFiles only returns files if you use glob, so look for a file that should be in every valid workspace
|
|
|
|
workspaces = findFiles(glob: '*/kibana/package.json')
|
|
|
|
.collect {
|
|
|
|
// get the paths to the kibana directories for the parallel workspaces
|
|
|
|
return parallelWorkspace + '/' + it.path.tokenize('/').dropRight(1).join('/')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return workspaces
|
|
|
|
}
|
|
|
|
|
2020-08-01 02:56:39 +02:00
|
|
|
def notifyOnError(Closure closure) {
|
|
|
|
try {
|
|
|
|
closure()
|
|
|
|
} catch (ex) {
|
|
|
|
// If this is the first failed step, it's likely that the error hasn't propagated up far enough to mark the build as a failure
|
|
|
|
currentBuild.result = 'FAILURE'
|
|
|
|
catchErrors {
|
|
|
|
githubPr.sendComment(false)
|
|
|
|
}
|
|
|
|
catchErrors {
|
|
|
|
// an empty map is a valid config, but is falsey, so let's use .has()
|
|
|
|
if (buildState.has('SLACK_NOTIFICATION_CONFIG')) {
|
|
|
|
slackNotifications.sendFailedBuild(buildState.get('SLACK_NOTIFICATION_CONFIG'))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
throw ex
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-04 19:13:51 +02:00
|
|
|
def withFunctionalTestEnv(List additionalEnvs = [], Closure closure) {
|
|
|
|
// This can go away once everything that uses the deprecated workers.parallelProcesses() is moved to task queue
|
|
|
|
def parallelId = env.TASK_QUEUE_PROCESS_ID ?: env.CI_PARALLEL_PROCESS_NUMBER
|
2020-07-08 22:05:12 +02:00
|
|
|
|
2020-08-04 19:13:51 +02:00
|
|
|
def kibanaPort = "61${parallelId}1"
|
|
|
|
def esPort = "61${parallelId}2"
|
|
|
|
def esTransportPort = "61${parallelId}3"
|
|
|
|
def ingestManagementPackageRegistryPort = "61${parallelId}4"
|
2020-08-25 01:43:44 +02:00
|
|
|
def alertingProxyPort = "61${parallelId}5"
|
2020-08-04 19:13:51 +02:00
|
|
|
|
|
|
|
withEnv([
|
|
|
|
"CI_GROUP=${parallelId}",
|
|
|
|
"REMOVE_KIBANA_INSTALL_DIR=1",
|
|
|
|
"CI_PARALLEL_PROCESS_NUMBER=${parallelId}",
|
|
|
|
"TEST_KIBANA_HOST=localhost",
|
|
|
|
"TEST_KIBANA_PORT=${kibanaPort}",
|
|
|
|
"TEST_KIBANA_URL=http://elastic:changeme@localhost:${kibanaPort}",
|
|
|
|
"TEST_ES_URL=http://elastic:changeme@localhost:${esPort}",
|
|
|
|
"TEST_ES_TRANSPORT_PORT=${esTransportPort}",
|
|
|
|
"KBN_NP_PLUGINS_BUILT=true",
|
|
|
|
"INGEST_MANAGEMENT_PACKAGE_REGISTRY_PORT=${ingestManagementPackageRegistryPort}",
|
2020-08-25 01:43:44 +02:00
|
|
|
"ALERTING_PROXY_PORT=${alertingProxyPort}"
|
2020-08-04 19:13:51 +02:00
|
|
|
] + additionalEnvs) {
|
|
|
|
closure()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def functionalTestProcess(String name, Closure closure) {
|
|
|
|
return {
|
|
|
|
withFunctionalTestEnv(["JOB=${name}"], closure)
|
2019-10-25 18:57:46 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-02 21:04:27 +01:00
|
|
|
def functionalTestProcess(String name, String script) {
|
|
|
|
return functionalTestProcess(name) {
|
2020-08-04 19:13:51 +02:00
|
|
|
notifyOnError {
|
|
|
|
retryable(name) {
|
|
|
|
runbld(script, "Execute ${name}")
|
|
|
|
}
|
2020-03-02 21:04:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def ossCiGroupProcess(ciGroup) {
|
|
|
|
return functionalTestProcess("ciGroup" + ciGroup) {
|
2019-10-25 18:57:46 +02:00
|
|
|
withEnv([
|
|
|
|
"CI_GROUP=${ciGroup}",
|
|
|
|
"JOB=kibana-ciGroup${ciGroup}",
|
|
|
|
]) {
|
2020-01-27 20:46:05 +01:00
|
|
|
retryable("kibana-ciGroup${ciGroup}") {
|
|
|
|
runbld("./test/scripts/jenkins_ci_group.sh", "Execute kibana-ciGroup${ciGroup}")
|
|
|
|
}
|
2019-10-25 18:57:46 +02:00
|
|
|
}
|
2020-03-02 21:04:27 +01:00
|
|
|
}
|
2019-10-25 18:57:46 +02:00
|
|
|
}
|
|
|
|
|
2020-03-02 21:04:27 +01:00
|
|
|
def xpackCiGroupProcess(ciGroup) {
|
|
|
|
return functionalTestProcess("xpack-ciGroup" + ciGroup) {
|
2019-10-25 18:57:46 +02:00
|
|
|
withEnv([
|
|
|
|
"CI_GROUP=${ciGroup}",
|
|
|
|
"JOB=xpack-kibana-ciGroup${ciGroup}",
|
|
|
|
]) {
|
2020-01-27 20:46:05 +01:00
|
|
|
retryable("xpack-kibana-ciGroup${ciGroup}") {
|
|
|
|
runbld("./test/scripts/jenkins_xpack_ci_group.sh", "Execute xpack-kibana-ciGroup${ciGroup}")
|
|
|
|
}
|
2019-10-25 18:57:46 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-11 17:42:43 +01:00
|
|
|
def uploadGcsArtifact(uploadPrefix, pattern) {
|
2019-10-25 18:57:46 +02:00
|
|
|
googleStorageUpload(
|
|
|
|
credentialsId: 'kibana-ci-gcs-plugin',
|
2019-12-11 17:42:43 +01:00
|
|
|
bucket: "gs://${uploadPrefix}",
|
2019-10-25 18:57:46 +02:00
|
|
|
pattern: pattern,
|
|
|
|
sharedPublicly: true,
|
|
|
|
showInline: true,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-01-08 21:08:48 +01:00
|
|
|
def downloadCoverageArtifacts() {
|
|
|
|
def storageLocation = "gs://kibana-ci-artifacts/jobs/${env.JOB_NAME}/${BUILD_NUMBER}/coverage/"
|
|
|
|
def targetLocation = "/tmp/downloaded_coverage"
|
|
|
|
|
|
|
|
sh "mkdir -p '${targetLocation}' && gsutil -m cp -r '${storageLocation}' '${targetLocation}'"
|
|
|
|
}
|
|
|
|
|
|
|
|
def uploadCoverageArtifacts(prefix, pattern) {
|
|
|
|
def uploadPrefix = "kibana-ci-artifacts/jobs/${env.JOB_NAME}/${BUILD_NUMBER}/coverage/${prefix}"
|
|
|
|
uploadGcsArtifact(uploadPrefix, pattern)
|
|
|
|
}
|
|
|
|
|
2019-12-11 17:42:43 +01:00
|
|
|
def withGcsArtifactUpload(workerName, closure) {
|
|
|
|
def uploadPrefix = "kibana-ci-artifacts/jobs/${env.JOB_NAME}/${BUILD_NUMBER}/${workerName}"
|
2019-10-25 18:57:46 +02:00
|
|
|
def ARTIFACT_PATTERNS = [
|
|
|
|
'target/kibana-*',
|
2020-08-04 19:13:51 +02:00
|
|
|
'target/test-metrics/*',
|
2020-06-18 08:22:50 +02:00
|
|
|
'target/kibana-security-solution/**/*.png',
|
2019-10-25 18:57:46 +02:00
|
|
|
'target/junit/**/*',
|
2020-08-04 19:13:51 +02:00
|
|
|
'target/test-suites-ci-plan.json',
|
|
|
|
'test/**/screenshots/session/*.png',
|
|
|
|
'test/**/screenshots/failure/*.png',
|
|
|
|
'test/**/screenshots/diff/*.png',
|
2019-10-25 18:57:46 +02:00
|
|
|
'test/functional/failure_debug/html/*.html',
|
2020-08-04 19:13:51 +02:00
|
|
|
'x-pack/test/**/screenshots/session/*.png',
|
|
|
|
'x-pack/test/**/screenshots/failure/*.png',
|
|
|
|
'x-pack/test/**/screenshots/diff/*.png',
|
2019-10-25 18:57:46 +02:00
|
|
|
'x-pack/test/functional/failure_debug/html/*.html',
|
|
|
|
'x-pack/test/functional/apps/reporting/reports/session/*.pdf',
|
|
|
|
]
|
|
|
|
|
2019-12-11 17:42:43 +01:00
|
|
|
withEnv([
|
|
|
|
"GCS_UPLOAD_PREFIX=${uploadPrefix}"
|
|
|
|
], {
|
|
|
|
try {
|
|
|
|
closure()
|
|
|
|
} finally {
|
2020-03-02 21:04:27 +01:00
|
|
|
catchErrors {
|
2019-12-11 17:42:43 +01:00
|
|
|
ARTIFACT_PATTERNS.each { pattern ->
|
|
|
|
uploadGcsArtifact(uploadPrefix, pattern)
|
|
|
|
}
|
2020-08-04 19:13:51 +02:00
|
|
|
|
|
|
|
dir(env.WORKSPACE) {
|
|
|
|
ARTIFACT_PATTERNS.each { pattern ->
|
|
|
|
uploadGcsArtifact(uploadPrefix, "parallel/*/kibana/${pattern}")
|
|
|
|
}
|
|
|
|
}
|
2019-12-11 17:42:43 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2020-01-08 21:08:48 +01:00
|
|
|
|
|
|
|
if (env.CODE_COVERAGE) {
|
|
|
|
sh 'tar -czf kibana-coverage.tar.gz target/kibana-coverage/**/*'
|
|
|
|
uploadGcsArtifact("kibana-ci-artifacts/jobs/${env.JOB_NAME}/${BUILD_NUMBER}/coverage/${workerName}", 'kibana-coverage.tar.gz')
|
|
|
|
}
|
2019-10-25 18:57:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
def publishJunit() {
|
|
|
|
junit(testResults: 'target/junit/**/*.xml', allowEmptyResults: true, keepLongStdio: true)
|
2020-08-04 19:13:51 +02:00
|
|
|
|
|
|
|
dir(env.WORKSPACE) {
|
|
|
|
junit(testResults: 'parallel/*/kibana/target/junit/**/*.xml', allowEmptyResults: true, keepLongStdio: true)
|
|
|
|
}
|
2019-10-25 18:57:46 +02:00
|
|
|
}
|
|
|
|
|
2020-08-15 01:32:45 +02:00
|
|
|
def sendMail(Map params = [:]) {
|
2019-10-25 18:57:46 +02:00
|
|
|
// If the build doesn't have a result set by this point, there haven't been any errors and it can be marked as a success
|
|
|
|
// The e-mail plugin for the infra e-mail depends upon this being set
|
|
|
|
currentBuild.result = currentBuild.result ?: 'SUCCESS'
|
|
|
|
|
|
|
|
def buildStatus = buildUtils.getBuildStatus()
|
|
|
|
if (buildStatus != 'SUCCESS' && buildStatus != 'ABORTED') {
|
|
|
|
node('flyweight') {
|
|
|
|
sendInfraMail()
|
2020-08-15 01:32:45 +02:00
|
|
|
sendKibanaMail(params)
|
2019-10-25 18:57:46 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def sendInfraMail() {
|
2020-03-02 21:04:27 +01:00
|
|
|
catchErrors {
|
2019-10-25 18:57:46 +02:00
|
|
|
step([
|
|
|
|
$class: 'Mailer',
|
|
|
|
notifyEveryUnstableBuild: true,
|
|
|
|
recipients: 'infra-root+build@elastic.co',
|
|
|
|
sendToIndividuals: false
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-15 01:32:45 +02:00
|
|
|
def sendKibanaMail(Map params = [:]) {
|
|
|
|
def config = [to: 'build-kibana@elastic.co'] + params
|
|
|
|
|
2020-03-02 21:04:27 +01:00
|
|
|
catchErrors {
|
2019-10-25 18:57:46 +02:00
|
|
|
def buildStatus = buildUtils.getBuildStatus()
|
|
|
|
if(params.NOTIFY_ON_FAILURE && buildStatus != 'SUCCESS' && buildStatus != 'ABORTED') {
|
|
|
|
emailext(
|
2020-08-15 01:32:45 +02:00
|
|
|
config.to,
|
2019-10-25 18:57:46 +02:00
|
|
|
subject: "${env.JOB_NAME} - Build # ${env.BUILD_NUMBER} - ${buildStatus}",
|
|
|
|
body: '${SCRIPT,template="groovy-html.template"}',
|
|
|
|
mimeType: 'text/html',
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-15 16:59:05 +01:00
|
|
|
def bash(script, label) {
|
|
|
|
sh(
|
|
|
|
script: "#!/bin/bash\n${script}",
|
|
|
|
label: label
|
|
|
|
)
|
2019-10-25 18:57:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
def doSetup() {
|
2020-08-01 02:56:39 +02:00
|
|
|
notifyOnError {
|
2020-07-21 22:51:58 +02:00
|
|
|
retryWithDelay(2, 15) {
|
2020-05-15 16:40:30 +02:00
|
|
|
try {
|
2020-07-21 22:51:58 +02:00
|
|
|
runbld("./test/scripts/jenkins_setup.sh", "Setup Build Environment and Dependencies")
|
|
|
|
} catch (ex) {
|
|
|
|
try {
|
|
|
|
// Setup expects this directory to be missing, so we need to remove it before we do a retry
|
|
|
|
bash("rm -rf ../elasticsearch", "Remove elasticsearch sibling directory, if it exists")
|
|
|
|
} finally {
|
|
|
|
throw ex
|
|
|
|
}
|
2020-05-15 16:40:30 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-25 18:57:46 +02:00
|
|
|
}
|
|
|
|
|
2020-08-04 19:13:51 +02:00
|
|
|
def buildOss(maxWorkers = '') {
|
2020-08-01 02:56:39 +02:00
|
|
|
notifyOnError {
|
2020-08-04 19:13:51 +02:00
|
|
|
withEnv(["KBN_OPTIMIZER_MAX_WORKERS=${maxWorkers}"]) {
|
|
|
|
runbld("./test/scripts/jenkins_build_kibana.sh", "Build OSS/Default Kibana")
|
|
|
|
}
|
2020-07-21 22:51:58 +02:00
|
|
|
}
|
2019-10-25 18:57:46 +02:00
|
|
|
}
|
|
|
|
|
2020-08-04 19:13:51 +02:00
|
|
|
def buildXpack(maxWorkers = '') {
|
2020-08-01 02:56:39 +02:00
|
|
|
notifyOnError {
|
2020-08-04 19:13:51 +02:00
|
|
|
withEnv(["KBN_OPTIMIZER_MAX_WORKERS=${maxWorkers}"]) {
|
|
|
|
runbld("./test/scripts/jenkins_xpack_build_kibana.sh", "Build X-Pack Kibana")
|
|
|
|
}
|
2020-07-21 22:51:58 +02:00
|
|
|
}
|
2019-10-25 18:57:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
def runErrorReporter() {
|
2020-08-04 19:13:51 +02:00
|
|
|
return runErrorReporter([pwd()])
|
|
|
|
}
|
|
|
|
|
|
|
|
def runErrorReporter(workspaces) {
|
2019-12-06 20:27:06 +01:00
|
|
|
def status = buildUtils.getBuildStatus()
|
|
|
|
def dryRun = status != "ABORTED" ? "" : "--no-github-update"
|
|
|
|
|
2020-08-04 19:13:51 +02:00
|
|
|
def globs = workspaces.collect { "'${it}/target/junit/**/*.xml'" }.join(" ")
|
|
|
|
|
2019-11-15 16:59:05 +01:00
|
|
|
bash(
|
|
|
|
"""
|
|
|
|
source src/dev/ci_setup/setup_env.sh
|
2020-08-04 19:13:51 +02:00
|
|
|
node scripts/report_failed_tests ${dryRun} ${globs}
|
2019-11-15 16:59:05 +01:00
|
|
|
""",
|
|
|
|
"Report failed tests, if necessary"
|
|
|
|
)
|
2019-10-25 18:57:46 +02:00
|
|
|
}
|
|
|
|
|
2020-03-02 21:04:27 +01:00
|
|
|
def call(Map params = [:], Closure closure) {
|
2020-06-23 19:32:03 +02:00
|
|
|
def config = [timeoutMinutes: 135, checkPrChanges: false, setCommitStatus: false] + params
|
2020-03-02 21:04:27 +01:00
|
|
|
|
|
|
|
stage("Kibana Pipeline") {
|
|
|
|
timeout(time: config.timeoutMinutes, unit: 'MINUTES') {
|
|
|
|
timestamps {
|
|
|
|
ansiColor('xterm') {
|
2020-06-23 19:32:03 +02:00
|
|
|
if (config.setCommitStatus) {
|
|
|
|
buildState.set('shouldSetCommitStatus', true)
|
|
|
|
}
|
2020-03-12 16:06:53 +01:00
|
|
|
if (config.checkPrChanges && githubPr.isPr()) {
|
2020-06-11 18:19:14 +02:00
|
|
|
pipelineLibraryTests()
|
|
|
|
|
2020-03-12 16:06:53 +01:00
|
|
|
print "Checking PR for changes to determine if CI needs to be run..."
|
|
|
|
|
|
|
|
if (prChanges.areChangesSkippable()) {
|
|
|
|
print "No changes requiring CI found in PR, skipping."
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
2020-06-23 19:32:03 +02:00
|
|
|
try {
|
|
|
|
closure()
|
|
|
|
} finally {
|
|
|
|
if (config.setCommitStatus) {
|
|
|
|
githubCommitStatus.onFinish()
|
|
|
|
}
|
|
|
|
}
|
2020-03-02 21:04:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-04 19:13:51 +02:00
|
|
|
// Creates a task queue using withTaskQueue, and copies the bootstrapped kibana repo into each process's workspace
|
|
|
|
// Note that node_modules are mostly symlinked to save time/space. See test/scripts/jenkins_setup_parallel_workspace.sh
|
|
|
|
def withCiTaskQueue(Map options = [:], Closure closure) {
|
|
|
|
def setupClosure = {
|
|
|
|
// This can't use runbld, because it expects the source to be there, which isn't yet
|
|
|
|
bash("${env.WORKSPACE}/kibana/test/scripts/jenkins_setup_parallel_workspace.sh", "Set up duplicate workspace for parallel process")
|
|
|
|
}
|
|
|
|
|
|
|
|
def config = [parallel: 24, setup: setupClosure] + options
|
|
|
|
|
|
|
|
withTaskQueue(config) {
|
|
|
|
closure.call()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def scriptTask(description, script) {
|
|
|
|
return {
|
|
|
|
withFunctionalTestEnv {
|
|
|
|
notifyOnError {
|
|
|
|
runbld(script, description)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def scriptTaskDocker(description, script) {
|
|
|
|
return {
|
|
|
|
withDocker(scriptTask(description, script))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def buildDocker() {
|
|
|
|
sh(
|
|
|
|
script: """
|
|
|
|
cp /usr/local/bin/runbld .ci/
|
|
|
|
cp /usr/local/bin/bash_standard_lib.sh .ci/
|
|
|
|
cd .ci
|
|
|
|
docker build -t kibana-ci -f ./Dockerfile .
|
|
|
|
""",
|
|
|
|
label: 'Build CI Docker image'
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
def withDocker(Closure closure) {
|
|
|
|
docker
|
|
|
|
.image('kibana-ci')
|
|
|
|
.inside(
|
|
|
|
"-v /etc/runbld:/etc/runbld:ro -v '${env.JENKINS_HOME}:${env.JENKINS_HOME}' -v '/dev/shm/workspace:/dev/shm/workspace' --shm-size 2GB --cpus 4",
|
|
|
|
closure
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
def buildOssPlugins() {
|
|
|
|
runbld('./test/scripts/jenkins_build_plugins.sh', 'Build OSS Plugins')
|
|
|
|
}
|
|
|
|
|
|
|
|
def buildXpackPlugins() {
|
|
|
|
runbld('./test/scripts/jenkins_xpack_build_plugins.sh', 'Build X-Pack Plugins')
|
|
|
|
}
|
|
|
|
|
|
|
|
def withTasks(Map params = [worker: [:]], Closure closure) {
|
|
|
|
catchErrors {
|
|
|
|
def config = [name: 'ci-worker', size: 'xxl', ramDisk: true] + (params.worker ?: [:])
|
|
|
|
|
|
|
|
workers.ci(config) {
|
|
|
|
withCiTaskQueue(parallel: 24) {
|
|
|
|
parallel([
|
|
|
|
docker: {
|
|
|
|
retry(2) {
|
|
|
|
buildDocker()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
// There are integration tests etc that require the plugins to be built first, so let's go ahead and build them before set up the parallel workspaces
|
|
|
|
ossPlugins: { buildOssPlugins() },
|
|
|
|
xpackPlugins: { buildXpackPlugins() },
|
|
|
|
])
|
|
|
|
|
|
|
|
catchErrors {
|
|
|
|
closure()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def allCiTasks() {
|
|
|
|
withTasks {
|
|
|
|
tasks.check()
|
|
|
|
tasks.lint()
|
|
|
|
tasks.test()
|
|
|
|
tasks.functionalOss()
|
|
|
|
tasks.functionalXpack()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-11 18:19:14 +02:00
|
|
|
def pipelineLibraryTests() {
|
|
|
|
whenChanged(['vars/', '.ci/pipeline-library/']) {
|
|
|
|
workers.base(size: 'flyweight', bootstrapped: false, ramDisk: false) {
|
|
|
|
dir('.ci/pipeline-library') {
|
|
|
|
sh './gradlew test'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-25 18:57:46 +02:00
|
|
|
return this
|