forked from earthly/earthly
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEarthfile
More file actions
44 lines (35 loc) · 917 Bytes
/
Earthfile
File metadata and controls
44 lines (35 loc) · 917 Bytes
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
VERSION 0.8
FROM node:latest
WORKDIR typescript-node-example
deps:
COPY package.json package-lock.json ./
RUN npm install
COPY tsconfig.json ./
COPY src src
build:
FROM +deps
RUN npx tsc
SAVE ARTIFACT dist /dist AS LOCAL dist
docker:
FROM +build
EXPOSE 8080
ENTRYPOINT ["node", "/typescript-node-example/dist/index.js"]
SAVE IMAGE typescript-node-example:latest
test-setup:
FROM +deps
COPY jest.config.ts jest.config.integration.ts ./
COPY integration integration
unit-test:
FROM +test-setup
RUN npm run test
integration-test:
FROM +test-setup
COPY +build/dist dist
WITH DOCKER --load typescript-node-example:latest=+docker
RUN docker run --rm -d -p 8080:8080 typescript-node-example:latest && npm run test:integration
END
all:
BUILD +build
BUILD +docker
BUILD +unit-test
BUILD +integration-test