mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-27 12:21:03 +00:00
Merge pull request #946 from hkjn/allow-empty-email
If email is unspecified, pass in -e ' ' to avoid having registry URL interpreted as email, which will fail cryptically.
This commit is contained in:
commit
50114f573c
1 changed files with 7 additions and 1 deletions
|
@ -94,8 +94,14 @@ func (d *Docker) Write(f *buildfile.Buildfile) {
|
||||||
|
|
||||||
// Login?
|
// Login?
|
||||||
if d.RegistryLogin == true {
|
if d.RegistryLogin == true {
|
||||||
|
// If email is unspecified, pass in -e ' ' to avoid having
|
||||||
|
// registry URL interpreted as email, which will fail cryptically.
|
||||||
|
emailOpt := "' '"
|
||||||
|
if d.Email != "" {
|
||||||
|
emailOpt = d.Email
|
||||||
|
}
|
||||||
f.WriteCmdSilent(fmt.Sprintf("docker login -u %s -p %s -e %s %s",
|
f.WriteCmdSilent(fmt.Sprintf("docker login -u %s -p %s -e %s %s",
|
||||||
d.Username, d.Password, d.Email, d.RegistryLoginUrl))
|
d.Username, d.Password, emailOpt, d.RegistryLoginUrl))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tag and push all tags
|
// Tag and push all tags
|
||||||
|
|
Loading…
Reference in a new issue