Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build local hasura image #64

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
}
Loading