Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: log when no artifacts are found for docker #3554

Merged
merged 1 commit into from Nov 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions internal/pipe/docker/docker.go
Expand Up @@ -104,10 +104,12 @@ func (Pipe) Publish(ctx *context.Context) error {
// Run the pipe.
func (Pipe) Run(ctx *context.Context) error {
g := semerrgroup.NewSkipAware(semerrgroup.New(ctx.Parallelism))
for _, docker := range ctx.Config.Dockers {
for i, docker := range ctx.Config.Dockers {
i := i
docker := docker
g.Go(func() error {
log.WithField("docker", docker).Debug("looking for artifacts matching")
log := log.WithField("index", i)
log.Debug("looking for artifacts matching")
filters := []artifact.Filter{
artifact.ByGoos(docker.Goos),
artifact.ByGoarch(docker.Goarch),
Expand All @@ -128,6 +130,9 @@ func (Pipe) Run(ctx *context.Context) error {
}
artifacts := ctx.Artifacts.Filter(artifact.And(filters...))
log.WithField("artifacts", artifacts.Paths()).Debug("found artifacts")
if len(artifacts.Paths()) == 0 {
log.Warn("not binaries or packages found for the given platform - COPY/ADD may not work")
}
return process(ctx, docker, artifacts.List())
})
}
Expand Down