grim/convey

Port from logrus to log/slog
default tip
5 months ago, Elliott Sales de Andrade
c588f9b3f559
Port from logrus to log/slog

This doesn't really take much advantage of structured logging beyond what is already done (`id` and `idColor`), and consequently the log handler does not try to do any handling of anything more than that (i.e., grouping, or arbitrary attributes beyond those defined).

One should maybe have a `Context` available to pass in, but there isn't one, and anyway, the log handler doesn't use it, so I've passed in a `TODO` instead.

Everything else is just normal import/rename changes.

Testing Done:
Ran `go run . run`

Reviewed at https://reviews.imfreedom.org/r/2871/
package docker
import (
"fmt"
"log/slog"
"keep.imfreedom.org/grim/convey/environment"
"keep.imfreedom.org/grim/convey/podman"
"keep.imfreedom.org/grim/convey/runtime"
"keep.imfreedom.org/grim/convey/yaml"
)
type Build struct {
Arguments yaml.StringOrSlice `yaml:"arguments"`
Dockerfile string `yaml:"dockerfile"`
Files yaml.StringOrSlice `yaml:"files"`
Labels yaml.StringOrSlice `yaml:"labels"`
Tag string `yaml:"tag"`
Tags yaml.StringOrSlice `yaml:"tags"`
Target string `yaml:"target"`
realBuild *podman.Build
}
func (b *Build) Execute(name string, logger *slog.Logger, stageEnv environment.Environment, rt *runtime.Runtime) error {
return b.realBuild.Execute(name, logger, stageEnv, rt)
}
func (b *Build) New() runtime.Task {
return &Build{}
}
func (b *Build) Valid() error {
if b.Tag != "" {
b.Tags = append([]string{b.Tag}, b.Tags...)
}
b.realBuild = &podman.Build{
Annotations: b.Labels,
Containerfile: b.Dockerfile,
Tags: b.Tags,
Target: b.Target,
}
return b.realBuild.Valid()
}
func (b *Build) Deprecated() error {
return fmt.Errorf("docker/build has been deprecated in favor of podman/build since 0.15.0")
}