From 9580de2ca1e94ac682a9a33e38d343d06fbbf5f0 Mon Sep 17 00:00:00 2001 From: Geoffrey Ragot Date: Fri, 27 Sep 2024 12:52:40 +0200 Subject: [PATCH] feat: optimize cache on +generate --- Earthfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Earthfile b/Earthfile index f512d37ce..c4af4d174 100644 --- a/Earthfile +++ b/Earthfile @@ -6,9 +6,10 @@ IMPORT github.com/formancehq/stack/releases:main AS releases FROM core+base-image +CACHE --persist --sharing=shared /go + sources: FROM core+builder-image - CACHE --persist --sharing=shared /go/pkg WORKDIR /src/pkg/client COPY pkg/client/go.mod pkg/client/go.sum ./ RUN go mod download @@ -20,9 +21,10 @@ sources: SAVE ARTIFACT /src generate: - FROM +sources + FROM core+builder-image RUN apk update && apk add openjdk11 DO --pass-args core+GO_INSTALL --package=go.uber.org/mock/mockgen@latest + COPY (+sources/*) /src WORKDIR /src DO --pass-args core+GO_GENERATE SAVE ARTIFACT internal AS LOCAL internal