mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-22 10:10:39 +00:00
Add email to login command when given
This commit is contained in:
parent
87e0bec62f
commit
cec1cb5d12
13
plugin.go
13
plugin.go
@ -123,6 +123,9 @@ const dockerExe = "/usr/local/bin/docker"
|
|||||||
|
|
||||||
// helper function to create the docker login command.
|
// helper function to create the docker login command.
|
||||||
func commandLogin(login Login) *exec.Cmd {
|
func commandLogin(login Login) *exec.Cmd {
|
||||||
|
if p.Login.Email != "" {
|
||||||
|
return commandLoginEmail(p.Login)
|
||||||
|
}
|
||||||
return exec.Command(
|
return exec.Command(
|
||||||
dockerExe, "login",
|
dockerExe, "login",
|
||||||
"-u", login.Username,
|
"-u", login.Username,
|
||||||
@ -131,6 +134,16 @@ func commandLogin(login Login) *exec.Cmd {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func commandLoginEmail(p.Login) *exec.Cmd {
|
||||||
|
return exec.Command(
|
||||||
|
dockerExe, "login",
|
||||||
|
"-u", login.Username,
|
||||||
|
"-p", login.Password,
|
||||||
|
"-e", login.Email,
|
||||||
|
login.Registry,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// helper function to create the docker info command.
|
// helper function to create the docker info command.
|
||||||
func commandVersion() *exec.Cmd {
|
func commandVersion() *exec.Cmd {
|
||||||
return exec.Command(dockerExe, "version")
|
return exec.Command(dockerExe, "version")
|
||||||
|
Loading…
Reference in New Issue
Block a user