File tree 1 file changed +11
-2
lines changed
contrib/integrations/artifactory/plugin-artifactory-build-info
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -148,8 +148,17 @@ func (e *artifactoryBuildInfoPlugin) Run(ctx context.Context, opts *integrationp
148
148
return fail ("unable to compute build info: %v" , err )
149
149
}
150
150
buildInfoRequest .Modules = modules
151
- if _ , err := artiClient .PublishBuildInfo (buildInfoRequest , artifactoryProjectKey ); err != nil {
152
- return fail ("unable to push build info: %v" , err )
151
+ var nbAttempts int
152
+ for {
153
+ nbAttempts ++
154
+ _ , err := artiClient .PublishBuildInfo (buildInfoRequest , artifactoryProjectKey )
155
+ if err == nil {
156
+ break
157
+ } else if nbAttempts >= 3 {
158
+ return fail ("unable to push build info: %v" , err )
159
+ } else {
160
+ fmt .Printf ("Error while pushing buildinfo %s %s. Retrying...\n " , buildInfoName , version )
161
+ }
153
162
}
154
163
155
164
// Temporary code
You can’t perform that action at this time.
0 commit comments