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

@@ -5,7 +5,7 @@ import (
"log"
"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"
)
func main() {
@@ -15,7 +15,6 @@ func main() {
log.Fatal(err)
}
}
func run(ctx context.Context) error {
builder, err := internal.New(ctx)
if err != nil {
@@ -23,5 +22,14 @@ func run(ctx context.Context) error {
}
defer builder.CleanUp()
return tasks.Build(builder, "some-image", "example/main.go")
return pipelines.
New(builder).
WithGolangBin(&pipelines.GolangBinOpts{
DockerImageOpt: &pipelines.DockerImageOpt{
ImageName: "golang-bin",
},
BuildPath: "example/golang-bin/main.go",
BinName: "golang-bin",
}).
Execute(ctx)
}