-
Notifications
You must be signed in to change notification settings - Fork 2
/
Earthfile
42 lines (35 loc) · 950 Bytes
/
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
VERSION 0.7
FROM earthly/dind:alpine-3.18
WORKDIR remult-cli
RUN apk add nodejs npm
deps:
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm
RUN pnpm install
COPY tsconfig.json .eslintrc .eslintignore ./
COPY src src
COPY scripts scripts
build:
FROM +deps
RUN pnpm build
SAVE ARTIFACT dist /dist AS LOCAL dist
lint:
FROM +deps
RUN pnpm lint
test-setup:
FROM +deps
COPY integration integration
test:
FROM +test-setup
COPY docker-compose.yml ./
COPY +build/dist ./dist
WITH DOCKER --compose docker-compose.yml
RUN while ! docker exec local_pgdb pg_isready; do sleep 1; done ;\
docker cp ./scripts/db/bookstore-schecma.sql local_pgdb:./bookstore-schecma.sql &&\
docker exec local_pgdb psql -U postgres -d bookstore_db -a -f bookstore-schecma.sql &&\
pnpm test:ci
END
all:
BUILD +build
BUILD +lint
BUILD +test