-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathMakefile
84 lines (63 loc) · 1.81 KB
/
Makefile
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
80
81
82
83
84
# opentrons ai client makefile
# using bash instead of /bin/bash in SHELL prevents macOS optimizing away our PATH update
SHELL := bash
# add node_modules/.bin to PATH
PATH := $(shell cd .. && yarn bin):$(PATH)
# dev server port
PORT ?= 5173
benchmark_output := $(shell node -e 'console.log(new Date());')
# These variables can be overriden when make is invoked to customize the
# behavior of jest
tests ?=
cov_opts ?= --coverage=true
test_opts ?=
# This variable is for all command
target ?= production
# standard targets
#####################################################################
.PHONY: all
all: clean build-$(target)
.PHONY: setup
setup:
yarn
.PHONY: clean
clean:
shx rm -rf dist
# artifacts
#####################################################################
.PHONY: build-production
build-production: export NODE_ENV := production
build-production:
vite build
git rev-parse HEAD > dist/.commit
.PHONY: build-staging
build-staging: export NODE_ENV := staging
build-staging:
vite build
git rev-parse HEAD > dist/.commit
# development
#####################################################################
.PHONY: dev
dev: export NODE_ENV := development
dev: export PORT := $(PORT)
dev:
vite serve
# production assets server
.PHONY: serve
serve: all
node ../scripts/serve-static dist
.PHONY: test
test:
$(MAKE) -C .. test-js-ai-client tests="$(tests)" test_opts="$(test_opts)"
.PHONY: test-cov
test-cov:
make -C .. test-js-ai-client tests=$(tests) test_opts="$(test_opts)" cov_opts="$(cov_opts)"
.PHONY: staging-deploy
staging-deploy:
aws s3 sync ./dist s3://staging-opentrons-ai-front-end/ --delete
.PHONY: prod-deploy
prod-deploy:
aws s3 sync ./dist s3://prod-opentrons-ai-front-end/ --delete
.PHONY: format-md-json
format-md-json:
yarn prettier --ignore-path .eslintignore --write **/*.md **/*.json