Adjust logging for Docker helper script

Signed-off-by: Amir Zarrinkafsh <nightah@me.com>
This commit is contained in:
Amir Zarrinkafsh 2019-11-30 14:41:53 +11:00 committed by Clément Michaud
parent 68845057a2
commit 6725dc753a

View File

@ -131,7 +131,7 @@ func login(docker *Docker) {
log.Fatal(errors.New("DOCKER_PASSWORD is empty")) log.Fatal(errors.New("DOCKER_PASSWORD is empty"))
} }
log.Debug("Login to dockerhub as " + username) log.Infof("Login to dockerhub as %s", username)
err := docker.Login(username, password) err := docker.Login(username, password)
if err != nil { if err != nil {
@ -142,7 +142,7 @@ func login(docker *Docker) {
func deploy(docker *Docker, tag string) { func deploy(docker *Docker, tag string) {
imageWithTag := DockerImageName + ":" + tag imageWithTag := DockerImageName + ":" + tag
log.Debug("Docker image " + imageWithTag + " will be deployed on Dockerhub") log.Infof("Docker image %s will be deployed on Dockerhub", imageWithTag)
if err := docker.Tag(DockerImageName, imageWithTag); err != nil { if err := docker.Tag(DockerImageName, imageWithTag); err != nil {
log.Fatal(err) log.Fatal(err)
@ -156,7 +156,7 @@ func deploy(docker *Docker, tag string) {
func deployManifest(docker *Docker, tag string, amd64tag string, arm32v7tag string, arm64v8tag string) { func deployManifest(docker *Docker, tag string, amd64tag string, arm32v7tag string, arm64v8tag string) {
dockerImagePrefix := DockerImageName + ":" dockerImagePrefix := DockerImageName + ":"
log.Debug("Docker manifest " + dockerImagePrefix + tag + " will be deployed on Dockerhub") log.Infof("Docker manifest %s%s will be deployed on Dockerhub", dockerImagePrefix, tag)
err := docker.Manifest(dockerImagePrefix+tag, dockerImagePrefix+amd64tag, dockerImagePrefix+arm32v7tag, dockerImagePrefix+arm64v8tag) err := docker.Manifest(dockerImagePrefix+tag, dockerImagePrefix+amd64tag, dockerImagePrefix+arm32v7tag, dockerImagePrefix+arm64v8tag)
@ -166,14 +166,14 @@ func deployManifest(docker *Docker, tag string, amd64tag string, arm32v7tag stri
tags := []string{amd64tag, arm32v7tag, arm64v8tag} tags := []string{amd64tag, arm32v7tag, arm64v8tag}
for _, t := range tags { for _, t := range tags {
log.Debug("Docker removing tag for " + dockerImagePrefix + t + " on Dockerhub.") log.Infof("Docker removing tag for %s%s on Dockerhub", dockerImagePrefix, t)
if err := docker.CleanTag(t); err != nil { if err := docker.CleanTag(t); err != nil {
panic(err) panic(err)
} }
} }
log.Debug("Docker pushing README.md to Dockerhub") log.Info("Docker pushing README.md to Dockerhub")
if err := docker.PublishReadme(); err != nil { if err := docker.PublishReadme(); err != nil {
log.Fatal(err) log.Fatal(err)