diff --git a/build/hasura/Dockerfile b/build/hasura/Dockerfile new file mode 100644 index 000000000..4937fa6db --- /dev/null +++ b/build/hasura/Dockerfile @@ -0,0 +1,3 @@ +FROM --platform=$TARGETPLATFORM hasura/graphql-engine:v2.35.0.cli-migrations-v3 +COPY hasura hasura +WORKDIR hasura diff --git a/build/hasura/images.go b/build/hasura/images.go new file mode 100644 index 000000000..6bdab2b3b --- /dev/null +++ b/build/hasura/images.go @@ -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}, + }) +} diff --git a/build/index.go b/build/index.go index 11830249f..56b7d3f90 100644 --- a/build/index.go +++ b/build/index.go @@ -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" ) @@ -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, }