Skip to content

Commit

Permalink
use go mod download and support windows as suggested in the code review
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v committed Oct 14, 2020
1 parent 2bc6d54 commit 2a7cd27
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,15 @@ def withBeatsEnv(Map args = [:], Closure body) {
git config --global user.email "beatsmachine@users.noreply.github.com"
git config --global user.name "beatsmachine"
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 (sh(label: 'Fetch go dependencies', script: 'go get ./...', returnStatus: true) > 0) {
sh(label: 'Fetch go dependencies - retry', script: 'go get ./...', returnStatus: true)
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)
}
}
try {
body()
} finally {
if (archive) {
Expand Down

0 comments on commit 2a7cd27

Please sign in to comment.