-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEarthfile
50 lines (35 loc) · 1.46 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
48
49
50
VERSION 0.7
IMPORT github.com/mortenlj/earthly-lib/kubernetes/commands AS lib-k8s-commands
FROM busybox
manifests:
# builtins must be declared
ARG EARTHLY_GIT_PROJECT_NAME
ARG EARTHLY_GIT_SHORT_HASH
ARG main_image=ghcr.io/$EARTHLY_GIT_PROJECT_NAME
ARG VERSION=$EARTHLY_GIT_SHORT_HASH
DO lib-k8s-commands+ASSEMBLE_MANIFESTS --IMAGE=${main_image} --VERSION=${VERSION}
docker:
FROM python:3.11-slim
WORKDIR /app
COPY --dir ./backend/+deps/.venv .
COPY --dir ./backend/+build/quotes .
COPY --keep-ts --dir --platform=linux/amd64 ./frontend/+build/build .
ENV PATH="/bin:/usr/bin:/usr/local/bin:/app/.venv/bin"
CMD ["/app/.venv/bin/python", "-m", "quotes"]
# builtins must be declared
ARG EARTHLY_GIT_PROJECT_NAME
ARG EARTHLY_GIT_SHORT_HASH
# Override from command-line on CI
ARG main_image=ghcr.io/$EARTHLY_GIT_PROJECT_NAME
ARG VERSION=$EARTHLY_GIT_SHORT_HASH
SAVE IMAGE --push ${main_image}:${VERSION} ${main_image}:latest
deploy:
# builtins must be declared
ARG EARTHLY_GIT_PROJECT_NAME
ARG EARTHLY_GIT_SHORT_HASH
ARG main_image=ghcr.io/$EARTHLY_GIT_PROJECT_NAME
ARG VERSION=$EARTHLY_GIT_SHORT_HASH
BUILD --platform=linux/amd64 ./frontend+build
BUILD --platform=linux/amd64 --platform=linux/arm64 ./backend+build
BUILD --platform=linux/amd64 --platform=linux/arm64 +docker --main_image=${main_image} --VERSION=${VERSION}
BUILD --platform=linux/amd64 +manifests