-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEarthfile
79 lines (67 loc) · 1.88 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
VERSION 0.8
FROM clojure:temurin-23-noble
DO github.com/earthly/lib+INSTALL_DIND
# setup dind for easy caching
# FROM earthly/dind:ubuntu-24.04-docker-27.3.1-1
RUN apt update
RUN apt install -y rlwrap curl unzip wget lcov
### nodejs
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
WORKDIR /build
### clj-kondo
RUN curl -sLO https://raw.githubusercontent.com/clj-kondo/clj-kondo/master/script/install-clj-kondo
RUN chmod +x install-clj-kondo
RUN ./install-clj-kondo
deps:
# copy all relevant files
COPY deps.edn tests.edn shadow-cljs.edn package.json /build
CACHE ./node_modules
CACHE ~/.m2
RUN clj -Stree
RUN npm install
RUN wget https://github.com/apple/foundationdb/releases/download/7.1.31/foundationdb-clients_7.1.31-1_amd64.deb
RUN dpkg -i foundationdb-clients_7.1.31-1_amd64.deb
RUN echo "docker:docker@127.0.0.1:4500" > /etc/foundationdb/fdb.cluster
build-base:
FROM +deps
# copy src here cause we want to maximize chance to cache deps
COPY --dir .clj-kondo build bin dev src doc test resources /build
lint:
FROM +build-base
RUN clj-kondo --parallel --lint src
RUN clj-kondo --parallel --lint test
build-main:
FROM +build-base
RUN clj -T:build compile-main
build-dev:
FROM +build-main
RUN clj -T:build compile-dev
build-jar:
FROM +build-dev
RUN clj -T:build jar
build-cljs:
FROM +build-base
RUN npx shadow-cljs compile doc
build-all:
BUILD +lint
BUILD +build-main
BUILD +build-dev
BUILD +build-jar
BUILD +build-cljs
test:
FROM +build-base
#DO github.com/earthly/lib+INSTALL_DIND
COPY docker ./docker
COPY docker-compose.yml ./
WITH DOCKER --compose docker-compose.yml
RUN bin/run-coverage
END
SAVE ARTIFACT ./coverage AS LOCAL ./coverage
SAVE ARTIFACT ./target AS LOCAL ./target
# dev targets
dev-up:
LOCALLY
RUN docker-compose up
dev-down:
LOCALLY
RUN docker-compose down