File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,10 @@ func (p Plugin) Exec() error {
164
164
}
165
165
}
166
166
167
+ // otherwise there is a possibility of parallel plugin execution in the same CI build
168
+ // resulting in different images having the same contents
169
+ setUniqueBuildName (& p .Build )
170
+
167
171
if p .Build .Squash && ! p .Daemon .Experimental {
168
172
fmt .Println ("Squash build flag is only available when Docker deamon is started with experimental flag. Ignoring..." )
169
173
p .Build .Squash = false
@@ -374,6 +378,12 @@ func commandBuild(build Build) *exec.Cmd {
374
378
return exec .Command (dockerExe , args ... )
375
379
}
376
380
381
+ func setUniqueBuildName (build * Build ) {
382
+ shortenCommitSHA := build .Name [0 :8 ]
383
+ imageName := build .Repo [strings .LastIndex (build .Repo , "/" )+ 1 : len (build .Repo )]
384
+ build .Name = fmt .Sprintf ("%s-%s" , imageName , shortenCommitSHA )
385
+ }
386
+
377
387
func getSecretStringCmdArg (kvp string ) (string , error ) {
378
388
return getSecretCmdArg (kvp , false )
379
389
}
You can’t perform that action at this time.
0 commit comments