with cli
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is passing

This commit is contained in:
Kasper Juul Hermansen 2022-10-30 18:48:11 +01:00
parent 00ecd00110
commit 1f8ef3bc6c
Signed by: kjuulh
GPG Key ID: 0F95C140730F2F23
3 changed files with 42 additions and 9 deletions

View File

@ -3,13 +3,13 @@ module ci
go 1.19
require (
git.front.kjuulh.io/kjuulh/dagger-go v0.0.6
git.front.kjuulh.io/kjuulh/dagger-go v0.0.8
github.com/spf13/cobra v1.6.1
)
require (
dagger.io/dagger v0.3.1 // indirect
git.front.kjuulh.io/kjuulh/byg v0.0.1 // indirect
git.front.kjuulh.io/kjuulh/byg v0.0.7 // indirect
github.com/Khan/genqlient v0.5.0 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/agext/levenshtein v1.2.3 // indirect

View File

@ -37,6 +37,8 @@ dagger.io/dagger v0.3.1/go.mod h1:+p5s9Itrr/KT4UttGNpeUTNtVQUI2z9LDIOH9wBzu8g=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
git.front.kjuulh.io/kjuulh/byg v0.0.1 h1:SBrM5WBv1zTzt29pQMwGUJljGRI7Li7uATnZ3taotC0=
git.front.kjuulh.io/kjuulh/byg v0.0.1/go.mod h1:8Vg5Mgqzva5fzHGeMlxjp/DMLbUy9uaKFxMNB34yYuA=
git.front.kjuulh.io/kjuulh/byg v0.0.7 h1:0ZDkRj1R2lvbWUQO5GjWJum9zpVMej6l8ZXn5YNmBNE=
git.front.kjuulh.io/kjuulh/byg v0.0.7/go.mod h1:8Vg5Mgqzva5fzHGeMlxjp/DMLbUy9uaKFxMNB34yYuA=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.3 h1:sigL3DSLEMsTYKJQjxbenLSeEKA4B53hIsPZlQPXzRM=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.3/go.mod h1:0AurXqWV23CwI3aFZ0UH1/aHSA5pa1sb0++FXrLTWkY=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.4 h1:boRYnBLPXT6lkT5pfVTpNRCMVx5igkUSFdPbkstEJBU=
@ -45,6 +47,10 @@ git.front.kjuulh.io/kjuulh/dagger-go v0.0.5 h1:bOledc4nP2OHEQXRzDCuMmVsT4EodL9yZ
git.front.kjuulh.io/kjuulh/dagger-go v0.0.5/go.mod h1:0AurXqWV23CwI3aFZ0UH1/aHSA5pa1sb0++FXrLTWkY=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.6 h1:7rNmurwH8GdbuaTfC/tNEg7uH8msSH1YQXqKaQRjetQ=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.6/go.mod h1:0AurXqWV23CwI3aFZ0UH1/aHSA5pa1sb0++FXrLTWkY=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.7 h1:/OvcLK5tOO+qPLf8XHdZKMwNa4//DhoZDbRBk23r02I=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.7/go.mod h1:N/EXT0aOJzph/9AXuFlaA2ZuKU0P8WzaDZQXLlAL0D8=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.8 h1:hbXEOYw3Q3sdwMjaEMz+v/TOnyUWSDAYFR8aQwQZF/o=
git.front.kjuulh.io/kjuulh/dagger-go v0.0.8/go.mod h1:N/EXT0aOJzph/9AXuFlaA2ZuKU0P8WzaDZQXLlAL0D8=
github.com/99designs/gqlgen v0.17.2/go.mod h1:K5fzLKwtph+FFgh9j7nFbRUdBKvTcGnsta51fsMTn3o=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=

View File

@ -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)
}
}