Skip to content

Commit

Permalink
[CI] Optimise stash/unstash performance (#18473)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored May 14, 2020
1 parent 5ecf75b commit ea8a649
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pipeline {
DOCKER_REGISTRY = 'docker.elastic.co'
AWS_ACCOUNT_SECRET = 'secret/observability-team/ci/elastic-observability-aws-account-auth'
RUNBLD_DISABLE_NOTIFICATIONS = 'true'
JOB_GCS_BUCKET = 'beats-ci-temp'
JOB_GCS_CREDENTIALS = 'beats-ci-gcs-plugin'
}
options {
timeout(time: 2, unit: 'HOURS')
Expand Down Expand Up @@ -57,7 +59,7 @@ pipeline {
pipelineManager([ cancelPreviousRunningBuilds: [ when: 'PR' ] ])
deleteDir()
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: true)
stash allowEmpty: true, name: 'source', useDefaultExcludes: false
stashV2(name: 'source', bucket: "${JOB_GCS_BUCKET}", credentialsId: "${JOB_GCS_CREDENTIALS}")
dir("${BASE_DIR}"){
loadConfigEnvVars()
}
Expand Down Expand Up @@ -722,7 +724,7 @@ def withBeatsEnv(boolean archive, Closure body) {
"DOCKER_PULL=0",
]) {
deleteDir()
unstash 'source'
unstashV2(name: 'source', bucket: "${JOB_GCS_BUCKET}", credentialsId: "${JOB_GCS_CREDENTIALS}")
if(isDockerInstalled()){
dockerLogin(secret: "${DOCKERELASTIC_SECRET}", registry: "${DOCKER_REGISTRY}")
}
Expand Down Expand Up @@ -763,7 +765,7 @@ def withBeatsEnvWin(Closure body) {
"RACE_DETECTOR=true",
]){
deleteDir()
unstash 'source'
unstashV2(name: 'source', bucket: "${JOB_GCS_BUCKET}", credentialsId: "${JOB_GCS_CREDENTIALS}")
dir("${env.BASE_DIR}"){
installTools()
try {
Expand Down Expand Up @@ -1027,7 +1029,7 @@ def terraformCleanup(String stashName, String directory) {
stage("Remove cloud scenarios in ${directory}"){
withCloudTestEnv() {
withBeatsEnv(false) {
unstash "terraform-${stashName}"
unstash("terraform-${stashName}")
retry(2) {
sh(label: "Terraform Cleanup", script: ".ci/scripts/terraform-cleanup.sh ${directory}")
}
Expand Down Expand Up @@ -1176,7 +1178,7 @@ def runbld() {
// Unstash the test reports
stashedTestReports.each { k, v ->
dir(k) {
unstash v
unstash(v)
}
}
sh(label: 'Process JUnit reports with runbld',
Expand Down

0 comments on commit ea8a649

Please sign in to comment.