-
Notifications
You must be signed in to change notification settings - Fork 0
/
react.mk
54 lines (41 loc) · 1.51 KB
/
react.mk
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
S3CMD ?= s3cmd
S3_FLAGS ?= --acl-public --delete-removed --no-progress --no-mime-magic --guess-mime-type
INTERMEDIATE_STEPS = mkdir -p dist/images && cp src/images/favicon-am.svg dist/images/favicon-am.svg && cp -r src/audio dist/audio
DIST_CLEAN = rm -rf dist
DATA_SENTINAL = src/data/triage.json src/data/medkit.json
src/data/triage.json: data/triage.csv
cd data && ./databuild.py triage.csv
src/data/medkit.json: data/medkit.csv
cd data && ./databuild.py medkit.csv
data: $(DATA_SENTINAL)
make src/data/triage.json
make src/data/medkit.json
runserver: $(JS_SENTINAL) $(DATA_SENTINAL)
-mkdir dist && mkdir dist/images
$(INTERMEDIATE_STEPS) && \
npm run dev
build: $(JS_SENTINAL) $(DATA_SENTINAL)
npm run build:dev && \
$(INTERMEDIATE_STEPS)
eslint: $(JS_SENTINAL) $(DATA_SENTINAL)
npm run eslint
test: $(JS_SENTINAL) eslint $(DATA_SENTINAL)
npm run test
npm run cypress:test
cypress:
npm run cypress:open
watch-test: $(JS_SENTINAL) $(DATA_SENTINAL)
npm run test:watch
snapshot: $(JS_SENTINAL) $(DATA_SENTINAL)
npm run test:snapshot
deploy-stage: $(JS_SENTINAL $(DATA_SENTINAL))
$(DIST_CLEAN) && \
npm run build:prod && \
$(INTERMEDIATE_STEPS) && \
$(S3CMD) $(S3_FLAGS) sync --exclude-from='.s3ignore' . s3://$(STAGING_BUCKET)/
deploy-prod: $(JS_SENTINAL) $(DATA_SENTINAL)
$(DIST_CLEAN) && \
npm run build:prod && \
$(INTERMEDIATE_STEPS) && \
$(S3CMD) $(S3_FLAGS) sync --exclude-from='.s3ignore' . s3://$(PROD_BUCKET)/
.PHONY: runserver build dev eslint test cypress deploy-stage deploy-prod cypress data