mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
94 lines
3.2 KiB
Plaintext
94 lines
3.2 KiB
Plaintext
VERSION 0.8
|
|
|
|
IMPORT github.com/formancehq/earthly:tags/v0.15.0 AS core
|
|
IMPORT ../.. AS stack
|
|
IMPORT ../../releases AS releases
|
|
|
|
FROM core+base-image
|
|
|
|
temporalite-build:
|
|
FROM core+builder-image
|
|
GIT CLONE --branch=v0.2.0 https://github.com/temporalio/temporalite.git /src
|
|
WORKDIR /src
|
|
ENV GOBIN=/go/bin
|
|
DO --pass-args core+GO_INSTALL --package=./cmd/temporalite
|
|
SAVE ARTIFACT $GOPATH/bin/temporalite
|
|
|
|
temporalite:
|
|
FROM core+final-image
|
|
COPY (+temporalite-build/temporalite) /bin/temporalite
|
|
EXPOSE 7233 8233
|
|
ENTRYPOINT ["/bin/temporalite", "start", "--ephemeral", "-n", "default", "--ip" , "0.0.0.0"]
|
|
|
|
SAVE IMAGE temporalite
|
|
|
|
tests:
|
|
FROM core+builder-image
|
|
WORKDIR /src
|
|
RUN apk update && apk add docker-cli-compose
|
|
COPY --pass-args (stack+sources/out --LOCATION=go.mod) /src/go.mod
|
|
COPY --pass-args (stack+sources/out --LOCATION=go.sum) /src/go.sum
|
|
COPY --pass-args (stack+sources/out --LOCATION=libs) /src/libs
|
|
COPY --pass-args (stack+sources/out --LOCATION=components/ledger) /src/components/ledger
|
|
COPY --pass-args (stack+sources/out --LOCATION=components/payments) /src/components/payments
|
|
COPY --pass-args (stack+sources/out --LOCATION=ee) /src/ee
|
|
COPY --pass-args (stack+build-final-spec/latest.json) /src/releases/build/latest.json
|
|
COPY --pass-args (releases+sdk-generate/go) /src/releases/sdks/go
|
|
COPY . /src/tests/integration
|
|
WORKDIR /src/tests/integration
|
|
DO --pass-args core+GO_INSTALL --package=github.com/onsi/ginkgo/v2/ginkgo
|
|
|
|
ARG GOPROXY
|
|
ARG focusFile
|
|
ARG skipFile
|
|
|
|
LET cmd="ginkgo -p"
|
|
IF [ $focusFile != "" ]
|
|
SET cmd="$cmd --focus-file=$focusFile"
|
|
END
|
|
IF [ $skipFile != "" ]
|
|
SET cmd="$cmd --skip-file=$skipFile"
|
|
END
|
|
|
|
WITH DOCKER \
|
|
--load temporalite=+temporalite \
|
|
--pull public.ecr.aws/formance-internal/jeffail/benthos:v4.23.1-es \
|
|
--compose docker-compose.yml
|
|
RUN --mount=type=cache,id=gomod,target=${GOPATH}/pkg/mod \
|
|
--mount=type=cache,id=gobuild,target=/root/.cache/go-build \
|
|
DOCKER_HOSTNAME=$(ip addr show docker0 | head -3 | tail -1 | cut -d / -f1 | cut -d\ -f6) \
|
|
$cmd ./suite/...
|
|
END
|
|
|
|
sources:
|
|
WORKDIR src
|
|
COPY --pass-args (stack+sources/out --LOCATION=libs) /src/libs
|
|
COPY --pass-args (releases+sdk-generate/go) /src/releases/sdks/go
|
|
COPY --pass-args (stack+sources/out --LOCATION=components/ledger) /src/components/ledger
|
|
COPY --pass-args (stack+sources/out --LOCATION=components/payments) /src/components/payments
|
|
COPY --pass-args (stack+sources/out --LOCATION=ee) /src/ee
|
|
COPY --pass-args (stack+sources/out --LOCATION=go.mod) /src/go.mod
|
|
COPY --pass-args (stack+sources/out --LOCATION=go.sum) /src/go.sum
|
|
COPY . /src/tests/integration
|
|
WORKDIR /src/tests/integration
|
|
SAVE ARTIFACT /src
|
|
|
|
lint:
|
|
FROM core+builder-image
|
|
COPY (+sources/*) /src
|
|
COPY --pass-args +tidy/go.* .
|
|
WORKDIR /src/tests/integration
|
|
DO --pass-args stack+GO_LINT
|
|
SAVE ARTIFACT * AS LOCAL ./
|
|
|
|
tidy:
|
|
FROM core+builder-image
|
|
COPY --pass-args (+sources/*) /src
|
|
WORKDIR /src/tests/integration
|
|
DO --pass-args stack+GO_TIDY
|
|
|
|
pre-commit:
|
|
WAIT
|
|
BUILD --pass-args +tidy
|
|
END
|