-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEarthfile
44 lines (40 loc) · 1.29 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
# This file is used to allow MacOS users to build images with DevEnv
# (https://github.com/cachix/devenv/issues/430)
VERSION 0.8
FROM scratch
backend:
FROM rust:latest
COPY --dir assets migration src templates .
COPY Cargo.toml Cargo.lock .
ARG --required EARTHLY_GIT_HASH
RUN VERSION=$EARTHLY_GIT_HASH cargo build --release
COPY config/production.yaml config/production.yaml
SAVE ARTIFACT target/release/bookclub-cli
build:
FROM debian:stable-slim
RUN apt update -yy && apt install -yy openssl
WORKDIR /usr/local/src
COPY --dir config assets .
COPY +backend/bookclub-cli .
ENTRYPOINT ["./bookclub-cli"]
ARG --required EARTHLY_GIT_HASH
ARG --required EARTHLY_GIT_BRANCH
SAVE IMAGE --push \
thoward27/bookclub:$EARTHLY_GIT_HASH \
thoward27/bookclub:$EARTHLY_GIT_BRANCH
levant-render:
FROM hashicorp/levant
WORKDIR /usr/local/src
COPY --dir levant/ ./
COPY Nomadfile ./
FOR vars IN $(ls ./levant)
RUN levant render -var-file=./levant/$vars ./Nomadfile > ./Nomadfile.$vars
END
SAVE ARTIFACT --force Nomadfile.*
nomad-validate:
FROM hashicorp/nomad
WORKDIR /usr/local/src
COPY +levant-render/Nomadfile.* ./
FOR nomadfile IN $(ls ./Nomadfile.*)
RUN nomad validate $nomadfile
END