with cli
This commit is contained in:
41
ci/main.go
41
ci/main.go
@@ -1,19 +1,46 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"git.front.kjuulh.io/kjuulh/dagger-go/pkg/builder"
|
||||
"git.front.kjuulh.io/kjuulh/dagger-go/pkg/cli"
|
||||
"github.com/spf13/cobra"
|
||||
"git.front.kjuulh.io/kjuulh/dagger-go/pkg/pipelines"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cmd := &cobra.Command{
|
||||
Use: "dagger-go",
|
||||
}
|
||||
err := cli.NewCustomGoBuild("golangbin", func(ctx context.Context) error {
|
||||
builder, err := builder.New(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
cmd.AddCommand(cli.Build("cmd/octopush/octopush.go", ""))
|
||||
if err := cmd.Execute(); err != nil {
|
||||
log.Fatal("%w", err)
|
||||
err = pipelines.
|
||||
New(builder).
|
||||
WithGolangBin(&pipelines.GolangBinOpts{
|
||||
DockerImageOpt: &pipelines.DockerImageOpt{
|
||||
ImageName: "octopush",
|
||||
},
|
||||
BuildPath: "cmd/octopush/octopush.go",
|
||||
BinName: "octopush",
|
||||
}).
|
||||
WithGolangBin(&pipelines.GolangBinOpts{
|
||||
DockerImageOpt: &pipelines.DockerImageOpt{
|
||||
ImageName: "octopush-server",
|
||||
},
|
||||
BuildPath: "cmd/server/server.go",
|
||||
BinName: "server",
|
||||
}).
|
||||
Execute(ctx)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user