Skip to content

Commit

Permalink
fix(contrib/artifactory): push build info retry (#6159)
Browse files Browse the repository at this point in the history
Signed-off-by: francois  samin <[email protected]>
  • Loading branch information
fsamin authored May 2, 2022
1 parent 6e9168d commit 8e3de55
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,17 @@ func (e *artifactoryBuildInfoPlugin) Run(ctx context.Context, opts *integrationp
return fail("unable to compute build info: %v", err)
}
buildInfoRequest.Modules = modules
if _, err := artiClient.PublishBuildInfo(buildInfoRequest, artifactoryProjectKey); err != nil {
return fail("unable to push build info: %v", err)
var nbAttempts int
for {
nbAttempts++
_, err := artiClient.PublishBuildInfo(buildInfoRequest, artifactoryProjectKey)
if err == nil {
break
} else if nbAttempts >= 3 {
return fail("unable to push build info: %v", err)
} else {
fmt.Printf("Error while pushing buildinfo %s %s. Retrying...\n", buildInfoName, version)
}
}

// Temporary code
Expand Down

0 comments on commit 8e3de55

Please sign in to comment.