-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEarthfile
47 lines (39 loc) · 1.14 KB
/
Earthfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
VERSION 0.8
IMPORT github.com/formancehq/earthly:tags/v0.16.2 AS core
FROM core+base-image
sources:
WORKDIR src
WORKDIR /src
COPY go.* .
COPY --dir pkg cmd internal .
COPY main.go .
SAVE ARTIFACT /src
compile:
FROM core+builder-image
COPY (+sources/*) /src
WORKDIR /src
ARG VERSION=latest
DO --pass-args core+GO_COMPILE --VERSION=$VERSION
build-image:
FROM core+final-image
ENTRYPOINT ["/bin/orchestration"]
CMD ["serve"]
COPY (+compile/main) /bin/orchestration
ARG REPOSITORY=ghcr.io
ARG tag=latest
DO core+SAVE_IMAGE --COMPONENT=orchestration --REPOSITORY=${REPOSITORY} --TAG=$tag
deploy:
COPY (+sources/*) /src
LET tag=$(tar cf - /src | sha1sum | awk '{print $1}')
WAIT
BUILD --pass-args +build-image --tag=$tag
END
FROM --pass-args core+vcluster-deployer-image
RUN kubectl patch Versions.formance.com default -p "{\"spec\":{\"orchestration\": \"${tag}\"}}" --type=merge
deploy-staging:
BUILD --pass-args core+deploy-staging
openapi:
FROM core+base-image
WORKDIR /src
COPY openapi.yaml openapi.yaml
SAVE ARTIFACT ./openapi.yaml