Skip to content

Commit

Permalink
Build local hasura image (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtek-coreum authored Mar 14, 2024
1 parent 6b52687 commit a3cd22b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
3 changes: 3 additions & 0 deletions build/hasura/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM --platform=$TARGETPLATFORM hasura/graphql-engine:v2.35.0.cli-migrations-v3
COPY hasura hasura
WORKDIR hasura
25 changes: 25 additions & 0 deletions build/hasura/images.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package hasura

import (
"context"
_ "embed"

"github.com/CoreumFoundation/coreum-tools/pkg/build"
"github.com/CoreumFoundation/crust/build/config"
"github.com/CoreumFoundation/crust/build/docker"
)

var (
//go:embed Dockerfile
dockerfile []byte
)

// BuildDockerImage builds docker image of the faucet.
func BuildDockerImage(ctx context.Context, deps build.DepsFunc) error {
return docker.BuildImage(ctx, docker.BuildImageConfig{
ContextDir: ".", // TODO (wojciech): Later on, move `hasura` dir here
ImageName: "hasura",
Dockerfile: dockerfile,
Versions: []string{config.ZNetVersion},
})
}
14 changes: 11 additions & 3 deletions build/index.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package build

import (
"context"

"github.com/CoreumFoundation/bdjuno/build/bdjuno"
"github.com/CoreumFoundation/bdjuno/build/hasura"
"github.com/CoreumFoundation/coreum-tools/pkg/build"
"github.com/CoreumFoundation/crust/build/crust"
)
Expand All @@ -10,7 +13,12 @@ import (
var Commands = map[string]build.CommandFunc{
"build/me": crust.BuildBuilder,
"build": bdjuno.Build,
"images": bdjuno.BuildDockerImage,
"test": bdjuno.Test,
"tidy": bdjuno.Tidy,
"images": func(ctx context.Context, deps build.DepsFunc) error {
deps(bdjuno.BuildDockerImage, hasura.BuildDockerImage)
return nil
},
"images/bdjuno": bdjuno.BuildDockerImage,
"images/hasura": hasura.BuildDockerImage,
"test": bdjuno.Test,
"tidy": bdjuno.Tidy,
}

0 comments on commit a3cd22b

Please sign in to comment.