ingore empty string tags
This commit is contained in:
parent
9a1c38c979
commit
06d32b13a5
@ -6,6 +6,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@ -99,7 +100,18 @@ func (p *Plugin) Validate() error {
|
|||||||
logrus.Printf("skipping automated docker build for %s", p.settings.Build.Ref)
|
logrus.Printf("skipping automated docker build for %s", p.settings.Build.Ref)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// ignore empty tags
|
||||||
|
var tags []string
|
||||||
|
for _, t := range p.settings.Build.Tags.Value() {
|
||||||
|
t = strings.TrimSpace(t)
|
||||||
|
if t != "" {
|
||||||
|
tags = append(tags, t)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
p.settings.Build.Tags = *cli.NewStringSlice(tags...)
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.settings.Build.LabelsAuto {
|
if p.settings.Build.LabelsAuto {
|
||||||
p.settings.Build.Labels = *cli.NewStringSlice(p.Labels()...)
|
p.settings.Build.Labels = *cli.NewStringSlice(p.Labels()...)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user