Skip to content

Commit 2a7cd27

Browse files
committed
use go mod download and support windows as suggested in the code review
1 parent 2bc6d54 commit 2a7cd27

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Jenkinsfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,15 @@ def withBeatsEnv(Map args = [:], Closure body) {
272272
git config --global user.email "[email protected]"
273273
git config --global user.name "beatsmachine"
274274
fi''')
275-
275+
}
276+
try {
276277
// Add more stability when dependencies are not accessible temporarily
277278
// See https://github.com/elastic/beats/issues/21609
278279
// retry/try/catch approach reports errors, let's avoid it to keep the
279280
// notifications cleaner.
280-
if (sh(label: 'Fetch go dependencies', script: 'go get ./...', returnStatus: true) > 0) {
281-
sh(label: 'Fetch go dependencies - retry', script: 'go get ./...', returnStatus: true)
281+
if (cmd(label: 'Download modules to local cache', script: 'go mod download', returnStatus: true) > 0) {
282+
cmd(label: 'Download modules to local cache - retry', script: 'go mod download', returnStatus: true)
282283
}
283-
}
284-
try {
285284
body()
286285
} finally {
287286
if (archive) {

0 commit comments

Comments
 (0)