mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-25 09:10:39 +00:00
More logging, disable docker login email, changes to makefile
This commit is contained in:
parent
74289a486c
commit
29dccc3dc3
3
Makefile
3
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)"
|
||||||
@ -13,6 +13,7 @@ clean:
|
|||||||
go clean -i ./...
|
go clean -i ./...
|
||||||
|
|
||||||
deps:
|
deps:
|
||||||
|
go get -u github.com/codegangsta/cli/...
|
||||||
go get -t ./...
|
go get -t ./...
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
|
@ -95,11 +95,11 @@ func (p Plugin) Exec() error {
|
|||||||
cmds = append(cmds, commandVersion()) // docker version
|
cmds = append(cmds, commandVersion()) // docker version
|
||||||
cmds = append(cmds, commandInfo()) // docker info
|
cmds = append(cmds, commandInfo()) // docker info
|
||||||
cmds = append(cmds, commandBuild(p.Build)) // docker build
|
cmds = append(cmds, commandBuild(p.Build)) // docker build
|
||||||
|
|
||||||
for _, tag := range p.Build.Tags {
|
for _, tag := range p.Build.Tags {
|
||||||
|
fmt.Fprintf(os.Stdout, "Tagging: %s\n", tag)
|
||||||
cmds = append(cmds, commandTag(p.Build, tag)) // docker tag
|
cmds = append(cmds, commandTag(p.Build, tag)) // docker tag
|
||||||
|
|
||||||
if p.Dryrun == false {
|
if p.Dryrun == false {
|
||||||
|
fmt.Fprintf(os.Stdout, "Pushing: %s\n", tag)
|
||||||
cmds = append(cmds, commandPush(p.Build, tag)) // docker push
|
cmds = append(cmds, commandPush(p.Build, tag)) // docker push
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -123,11 +123,12 @@ 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 {
|
||||||
|
fmt.Fprintf(os.Stdout, "Logging in to registry: %s with user: %s and email: %s\n", login.Registry, login.Username, login.Email)
|
||||||
return exec.Command(
|
return exec.Command(
|
||||||
dockerExe, "login",
|
dockerExe, "login",
|
||||||
"-u", login.Username,
|
"-u", login.Username,
|
||||||
"-p", login.Password,
|
"-p", login.Password,
|
||||||
"-e", login.Email,
|
// "-e", login.Email,
|
||||||
login.Registry,
|
login.Registry,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user