rework pipeline

This commit is contained in:
2022-10-30 18:13:57 +01:00
parent cadac9fc08
commit 2b641df577
15 changed files with 345 additions and 52 deletions

View File

@@ -7,7 +7,7 @@ import (
"os"
"git.front.kjuulh.io/kjuulh/dagger-go/internal"
"git.front.kjuulh.io/kjuulh/dagger-go/pkg/tasks"
"git.front.kjuulh.io/kjuulh/dagger-go/pkg/pipelines"
"github.com/spf13/cobra"
)
@@ -31,13 +31,23 @@ func Build(mainGoPath string, imageTag string) *cobra.Command {
log.Printf("Building image: %s\n", imageTag)
client, err := internal.New(ctx)
builder, err := internal.New(ctx)
if err != nil {
return err
}
defer client.CleanUp()
defer builder.CleanUp()
return pipelines.
New(builder).
WithGolangBin(&pipelines.GolangBinOpts{
DockerImageOpt: &pipelines.DockerImageOpt{
ImageName: "golang-bin",
},
BuildPath: "example/golang-bin/main.go",
BinName: "golang-bin",
}).
Execute(ctx)
return tasks.Build(client, imageTag, mainGoPath)
},
}