mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Add labels to shell scripts in Jenkins (#49657)
This commit is contained in:
parent
a32213f849
commit
504604a4f2
4 changed files with 47 additions and 32 deletions
|
@ -34,7 +34,7 @@ stage("Kibana Pipeline") {
|
|||
if (!IS_XPACK) {
|
||||
kibanaPipeline.buildOss()
|
||||
if (CI_GROUP == '1') {
|
||||
runbld "./test/scripts/jenkins_build_kbn_tp_sample_panel_action.sh"
|
||||
runbld("./test/scripts/jenkins_build_kbn_tp_sample_panel_action.sh", "Build kbn tp sample panel action for ciGroup1")
|
||||
}
|
||||
} else {
|
||||
kibanaPipeline.buildXpack()
|
||||
|
@ -62,18 +62,18 @@ stage("Kibana Pipeline") {
|
|||
def getWorkerFromParams(isXpack, job, ciGroup) {
|
||||
if (!isXpack) {
|
||||
if (job == 'firefoxSmoke') {
|
||||
return kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld './test/scripts/jenkins_firefox_smoke.sh' })
|
||||
return kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld('./test/scripts/jenkins_firefox_smoke.sh', 'Execute kibana-firefoxSmoke') })
|
||||
} else if(job == 'visualRegression') {
|
||||
return kibanaPipeline.getPostBuildWorker('visualRegression', { runbld './test/scripts/jenkins_visual_regression.sh' })
|
||||
return kibanaPipeline.getPostBuildWorker('visualRegression', { runbld('./test/scripts/jenkins_visual_regression.sh', 'Execute kibana-visualRegression') })
|
||||
} else {
|
||||
return kibanaPipeline.getOssCiGroupWorker(ciGroup)
|
||||
}
|
||||
}
|
||||
|
||||
if (job == 'firefoxSmoke') {
|
||||
return kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld './test/scripts/jenkins_xpack_firefox_smoke.sh' })
|
||||
return kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld('./test/scripts/jenkins_xpack_firefox_smoke.sh', 'Execute xpack-firefoxSmoke') })
|
||||
} else if(job == 'visualRegression') {
|
||||
return kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld './test/scripts/jenkins_xpack_visual_regression.sh' })
|
||||
return kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld('./test/scripts/jenkins_xpack_visual_regression.sh', 'Execute xpack-visualRegression') })
|
||||
} else {
|
||||
return kibanaPipeline.getXpackCiGroupWorker(ciGroup)
|
||||
}
|
||||
|
|
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
|
@ -24,9 +24,9 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
|
|||
'oss-ciGroup10': kibanaPipeline.getOssCiGroupWorker(10),
|
||||
'oss-ciGroup11': kibanaPipeline.getOssCiGroupWorker(11),
|
||||
'oss-ciGroup12': kibanaPipeline.getOssCiGroupWorker(12),
|
||||
'oss-firefoxSmoke': kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld './test/scripts/jenkins_firefox_smoke.sh' }),
|
||||
'oss-accessibility': kibanaPipeline.getPostBuildWorker('accessibility', { runbld './test/scripts/jenkins_accessibility.sh' }),
|
||||
'oss-visualRegression': kibanaPipeline.getPostBuildWorker('visualRegression', { runbld './test/scripts/jenkins_visual_regression.sh' }),
|
||||
'oss-firefoxSmoke': kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld('./test/scripts/jenkins_firefox_smoke.sh', 'Execute kibana-firefoxSmoke') }),
|
||||
'oss-accessibility': kibanaPipeline.getPostBuildWorker('accessibility', { runbld('./test/scripts/jenkins_accessibility.sh', 'Execute kibana-accessibility') }),
|
||||
'oss-visualRegression': kibanaPipeline.getPostBuildWorker('visualRegression', { runbld('./test/scripts/jenkins_visual_regression.sh', 'Execute kibana-visualRegression') }),
|
||||
]),
|
||||
'kibana-xpack-agent': kibanaPipeline.withWorkers('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
|
||||
'xpack-ciGroup1': kibanaPipeline.getXpackCiGroupWorker(1),
|
||||
|
@ -39,9 +39,9 @@ stage("Kibana Pipeline") { // This stage is just here to help the BlueOcean UI a
|
|||
'xpack-ciGroup8': kibanaPipeline.getXpackCiGroupWorker(8),
|
||||
'xpack-ciGroup9': kibanaPipeline.getXpackCiGroupWorker(9),
|
||||
'xpack-ciGroup10': kibanaPipeline.getXpackCiGroupWorker(10),
|
||||
'xpack-firefoxSmoke': kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld './test/scripts/jenkins_xpack_firefox_smoke.sh' }),
|
||||
'xpack-accessibility': kibanaPipeline.getPostBuildWorker('xpack-accessibility', { runbld './test/scripts/jenkins_xpack_accessibility.sh' }),
|
||||
'xpack-visualRegression': kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld './test/scripts/jenkins_xpack_visual_regression.sh' }),
|
||||
'xpack-firefoxSmoke': kibanaPipeline.getPostBuildWorker('xpack-firefoxSmoke', { runbld('./test/scripts/jenkins_xpack_firefox_smoke.sh', 'Execute xpack-firefoxSmoke') }),
|
||||
'xpack-accessibility': kibanaPipeline.getPostBuildWorker('xpack-accessibility', { runbld('./test/scripts/jenkins_xpack_accessibility.sh', 'Execute xpack-accessibility') }),
|
||||
'xpack-visualRegression': kibanaPipeline.getPostBuildWorker('xpack-visualRegression', { runbld('./test/scripts/jenkins_xpack_visual_regression.sh', 'Execute xpack-visualRegression') }),
|
||||
]),
|
||||
])
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ def getOssCiGroupWorker(ciGroup) {
|
|||
"CI_GROUP=${ciGroup}",
|
||||
"JOB=kibana-ciGroup${ciGroup}",
|
||||
]) {
|
||||
runbld "./test/scripts/jenkins_ci_group.sh"
|
||||
runbld("./test/scripts/jenkins_ci_group.sh", "Execute kibana-ciGroup${ciGroup}")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ def getXpackCiGroupWorker(ciGroup) {
|
|||
"CI_GROUP=${ciGroup}",
|
||||
"JOB=xpack-kibana-ciGroup${ciGroup}",
|
||||
]) {
|
||||
runbld "./test/scripts/jenkins_xpack_ci_group.sh"
|
||||
runbld("./test/scripts/jenkins_xpack_ci_group.sh", "Execute xpack-kibana-ciGroup${ciGroup}")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ def legacyJobRunner(name) {
|
|||
]) {
|
||||
jobRunner('linux && immutable', false) {
|
||||
try {
|
||||
runbld('.ci/run.sh', true)
|
||||
runbld('.ci/run.sh', "Execute ${name}", true)
|
||||
} finally {
|
||||
catchError {
|
||||
uploadAllGcsArtifacts(name)
|
||||
|
@ -118,12 +118,15 @@ def jobRunner(label, useRamDisk, closure) {
|
|||
// Move to a temporary workspace, so that we can symlink the real workspace into /dev/shm
|
||||
def originalWorkspace = env.WORKSPACE
|
||||
ws('/tmp/workspace') {
|
||||
sh """
|
||||
mkdir -p /dev/shm/workspace
|
||||
mkdir -p '${originalWorkspace}' # create all of the directories leading up to the workspace, if they don't exist
|
||||
rm --preserve-root -rf '${originalWorkspace}' # then remove just the workspace, just in case there's stuff in it
|
||||
ln -s /dev/shm/workspace '${originalWorkspace}'
|
||||
"""
|
||||
sh(
|
||||
script: """
|
||||
mkdir -p /dev/shm/workspace
|
||||
mkdir -p '${originalWorkspace}' # create all of the directories leading up to the workspace, if they don't exist
|
||||
rm --preserve-root -rf '${originalWorkspace}' # then remove just the workspace, just in case there's stuff in it
|
||||
ln -s /dev/shm/workspace '${originalWorkspace}'
|
||||
""",
|
||||
label: "Move workspace to RAM - /dev/shm/workspace"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -235,27 +238,33 @@ def sendKibanaMail() {
|
|||
}
|
||||
}
|
||||
|
||||
def bash(script) {
|
||||
sh "#!/bin/bash\n${script}"
|
||||
def bash(script, label) {
|
||||
sh(
|
||||
script: "#!/bin/bash\n${script}",
|
||||
label: label
|
||||
)
|
||||
}
|
||||
|
||||
def doSetup() {
|
||||
runbld "./test/scripts/jenkins_setup.sh"
|
||||
runbld("./test/scripts/jenkins_setup.sh", "Setup Build Environment and Dependencies")
|
||||
}
|
||||
|
||||
def buildOss() {
|
||||
runbld "./test/scripts/jenkins_build_kibana.sh"
|
||||
runbld("./test/scripts/jenkins_build_kibana.sh", "Build OSS/Default Kibana")
|
||||
}
|
||||
|
||||
def buildXpack() {
|
||||
runbld "./test/scripts/jenkins_xpack_build_kibana.sh"
|
||||
runbld("./test/scripts/jenkins_xpack_build_kibana.sh", "Build X-Pack Kibana")
|
||||
}
|
||||
|
||||
def runErrorReporter() {
|
||||
bash """
|
||||
source src/dev/ci_setup/setup_env.sh
|
||||
node scripts/report_failed_tests
|
||||
"""
|
||||
bash(
|
||||
"""
|
||||
source src/dev/ci_setup/setup_env.sh
|
||||
node scripts/report_failed_tests
|
||||
""",
|
||||
"Report failed tests, if necessary"
|
||||
)
|
||||
}
|
||||
|
||||
return this
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
def call(script, enableJunitProcessing = false) {
|
||||
def call(script, label, enableJunitProcessing = false) {
|
||||
def extraConfig = enableJunitProcessing ? "" : "--config ${env.WORKSPACE}/kibana/.ci/runbld_no_junit.yml"
|
||||
|
||||
sh "/usr/local/bin/runbld -d '${pwd()}' ${extraConfig} ${script}"
|
||||
sh(
|
||||
script: "/usr/local/bin/runbld -d '${pwd()}' ${extraConfig} ${script}",
|
||||
label: label ?: script
|
||||
)
|
||||
}
|
||||
|
||||
def junit() {
|
||||
sh "/usr/local/bin/runbld -d '${pwd()}' ${env.WORKSPACE}/kibana/test/scripts/jenkins_runbld_junit.sh"
|
||||
sh(
|
||||
script: "/usr/local/bin/runbld -d '${pwd()}' ${env.WORKSPACE}/kibana/test/scripts/jenkins_runbld_junit.sh",
|
||||
label: "Process JUnit reports with runbld"
|
||||
)
|
||||
}
|
||||
|
||||
return this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue