Merge pull request #61 from vespakoen/more-logging
More logging, disable docker login email, changes to makefile
This commit is contained in:
commit
82104c20c8
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
|||||||
.PHONY: all clean deps fmt vet test docker
|
.PHONY: all clean deps fmt vet test docker
|
||||||
|
|
||||||
EXECUTABLE ?= drone-docker
|
EXECUTABLE ?= drone-docker
|
||||||
IMAGE ?= plugins/$(EXECUTABLE)
|
IMAGE ?= plugins/docker
|
||||||
COMMIT ?= $(shell git rev-parse --short HEAD)
|
COMMIT ?= $(shell git rev-parse --short HEAD)
|
||||||
|
|
||||||
LDFLAGS = -X "main.buildCommit=$(COMMIT)"
|
LDFLAGS = -X "main.buildCommit=$(COMMIT)"
|
||||||
|
12
plugin.go
12
plugin.go
@ -123,6 +123,18 @@ 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 login.Email != "" {
|
||||||
|
return commandLoginEmail(login)
|
||||||
|
}
|
||||||
|
return exec.Command(
|
||||||
|
dockerExe, "login",
|
||||||
|
"-u", login.Username,
|
||||||
|
"-p", login.Password,
|
||||||
|
login.Registry,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
func commandLoginEmail(login Login) *exec.Cmd {
|
||||||
return exec.Command(
|
return exec.Command(
|
||||||
dockerExe, "login",
|
dockerExe, "login",
|
||||||
"-u", login.Username,
|
"-u", login.Username,
|
||||||
|
Loading…
Reference in New Issue
Block a user