1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

docker: added missing params to artifact

closes #486
This commit is contained in:
Carlos Alexandro Becker 2017-12-29 15:07:15 -02:00
parent 7910863ecd
commit 98b70f460e
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -181,7 +181,7 @@ func publish(ctx *context.Context, docker config.Docker, image, latest string) e
log.Warn("skipping push because --skip-publish is set")
return nil
}
if err := dockerPush(ctx, image); err != nil {
if err := dockerPush(ctx, docker, image); err != nil {
return err
}
if !docker.Latest {
@ -190,7 +190,7 @@ func publish(ctx *context.Context, docker config.Docker, image, latest string) e
if err := dockerTag(image, latest); err != nil {
return err
}
return dockerPush(ctx, latest)
return dockerPush(ctx, docker, latest)
}
func dockerBuild(root, dockerfile, image string) error {
@ -219,7 +219,7 @@ func dockerTag(image, tag string) error {
return nil
}
func dockerPush(ctx *context.Context, image string) error {
func dockerPush(ctx *context.Context, docker config.Docker, image string) error {
log.WithField("image", image).Info("pushing docker image")
/* #nosec */
var cmd = exec.Command("docker", "push", image)
@ -230,9 +230,12 @@ func dockerPush(ctx *context.Context, image string) error {
}
log.Debugf("docker push output: \n%s", string(out))
ctx.Artifacts.Add(artifact.Artifact{
Type: artifact.DockerImage,
Name: image,
// TODO: are the rest of the params relevant here?
Type: artifact.DockerImage,
Name: image,
Path: image,
Goarch: docker.Goarch,
Goos: docker.Goos,
Goarm: docker.Goarm,
})
return nil
}