diff --git a/Dockerfile b/Dockerfile index 680b520..a3c2b05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,13 @@ FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.23.2 AS builder WORKDIR /go/src/github.com/cloudoperators/heureka ADD . . -RUN go generate ./... + +# generate mock code files +RUN go install github.com/vektra/mockery/v2@v2.46.3 +RUN mockery +# generate graphql code +RUN cd internal/api/graphql && go run github.com/99designs/gqlgen generate + RUN CGO_ENABLED=0 go build -o /go/bin/heureka cmd/heureka/main.go FROM --platform=${BUILDPLATFORM:-linux/amd64} gcr.io/distroless/static-debian12:nonroot diff --git a/internal/api/graphql/graph/resolver/resolver.go b/internal/api/graphql/graph/resolver/resolver.go index c76768a..9ffa9c1 100644 --- a/internal/api/graphql/graph/resolver/resolver.go +++ b/internal/api/graphql/graph/resolver/resolver.go @@ -3,8 +3,6 @@ package resolver -//go:generate go run github.com/99designs/gqlgen generate - import ( "github.com/cloudoperators/heureka/internal/api/graphql/graph" "github.com/cloudoperators/heureka/internal/app" diff --git a/internal/database/interface.go b/internal/database/interface.go index 6d27068..6bc9463 100644 --- a/internal/database/interface.go +++ b/internal/database/interface.go @@ -3,9 +3,6 @@ package database -//go:generate go install github.com/vektra/mockery/v2@v2.46.3 -//go:generate mockery - import "github.com/cloudoperators/heureka/internal/entity" type Database interface {