From 11eaf3eed11b3a176a1b9b1bc4c9f29f7b7db1f6 Mon Sep 17 00:00:00 2001 From: Philip Hyunsu Cho Date: Mon, 8 Oct 2018 11:39:00 -0700 Subject: [PATCH] Retry Jenkins CI tests up to 3 times to improve reliability (redux) (#3776) --- Jenkinsfile-restricted | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile-restricted b/Jenkinsfile-restricted index 825d0bc4f..a9f1db9ae 100644 --- a/Jenkinsfile-restricted +++ b/Jenkinsfile-restricted @@ -48,22 +48,21 @@ pipeline { } } stage('Jenkins: Build doc') { - retry(3) { - agent { - label 'linux && cpu && restricted' - } - steps { - unstash name: 'srcs' - script { - def commit_id = "${GIT_COMMIT}" - def branch_name = "${GIT_LOCAL_BRANCH}" - echo 'Building doc...' - dir ('jvm-packages') { - sh "bash ./build_doc.sh ${commit_id}" - archiveArtifacts artifacts: "${commit_id}.tar.bz2", allowEmptyArchive: true - echo 'Deploying doc...' - withAWS(credentials:'xgboost-doc-bucket') { - s3Upload file: "${commit_id}.tar.bz2", bucket: 'xgboost-docs', acl: 'PublicRead', path: "${branch_name}.tar.bz2" + steps { + script { + retry(3) { + node('linux && cpu && restricted') { + unstash name: 'srcs' + def commit_id = "${GIT_COMMIT}" + def branch_name = "${GIT_LOCAL_BRANCH}" + echo 'Building doc...' + dir ('jvm-packages') { + sh "bash ./build_doc.sh ${commit_id}" + archiveArtifacts artifacts: "${commit_id}.tar.bz2", allowEmptyArchive: true + echo 'Deploying doc...' + withAWS(credentials:'xgboost-doc-bucket') { + s3Upload file: "${commit_id}.tar.bz2", bucket: 'xgboost-docs', acl: 'PublicRead', path: "${branch_name}.tar.bz2" + } } } }