mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-24 23:00:39 +00:00
fix: allow multi-platform builds using --push flag (#29)
This commit is contained in:
parent
562ee26fda
commit
a6cc96fbda
@ -65,7 +65,6 @@ func commandBuild(build Build) *exec.Cmd {
|
||||
args := []string{
|
||||
"buildx",
|
||||
"build",
|
||||
"--load",
|
||||
"--rm=true",
|
||||
"-f", build.Dockerfile,
|
||||
"-t", build.Name,
|
||||
@ -107,6 +106,12 @@ func commandBuild(build Build) *exec.Cmd {
|
||||
args = append(args, "--quiet")
|
||||
}
|
||||
|
||||
if len(build.Platforms.Value()) > 1 {
|
||||
args = append(args, "--push")
|
||||
} else {
|
||||
args = append(args, "--load")
|
||||
}
|
||||
|
||||
if len(build.Platforms.Value()) > 0 {
|
||||
args = append(args, "--platform", strings.Join(build.Platforms.Value()[:], ","))
|
||||
}
|
||||
|
@ -83,6 +83,10 @@ func (p *Plugin) Validate() error {
|
||||
p.settings.Build.Ref = p.pipeline.Commit.Ref
|
||||
p.settings.Daemon.Registry = p.settings.Login.Registry
|
||||
|
||||
if len(p.settings.Build.Platforms.Value()) > 1 && p.settings.Dryrun {
|
||||
return fmt.Errorf("dryrun is not supported on multi-platform builds")
|
||||
}
|
||||
|
||||
if p.settings.Build.TagsAuto {
|
||||
// return true if tag event or default branch
|
||||
if UseDefaultTag(
|
||||
|
Loading…
Reference in New Issue
Block a user