From 5498661d384b1ff28fb8094f089426fe82da3245 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Fri, 16 Oct 2020 09:57:23 +0100 Subject: [PATCH] [BUILD][CI] fetch dependencies with retry (#21614) (#21831) --- Jenkinsfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index fd6bb5d414e..e36a2c70db9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -285,6 +285,13 @@ def withBeatsEnv(Map args = [:], Closure body) { fi''') } try { + // Add more stability when dependencies are not accessible temporarily + // See https://github.com/elastic/beats/issues/21609 + // retry/try/catch approach reports errors, let's avoid it to keep the + // notifications cleaner. + if (cmd(label: 'Download modules to local cache', script: 'go mod download', returnStatus: true) > 0) { + cmd(label: 'Download modules to local cache - retry', script: 'go mod download', returnStatus: true) + } body() } finally { if (archive) {