-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (34 loc) · 1.3 KB
/
Makefile
File metadata and controls
43 lines (34 loc) · 1.3 KB
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
# build output folder
OUTPUTFOLDER = build
# docker image
S3_BUCKET = s3://utu-app-wallet
CF_DISTRIBUTION_ID = ES8ZCV0DVZQZH
S3_STAGE_BUCKET = s3://stage-utu-dapp
CF_STAGE_DISTRIBUTION_ID = ETZYYBW8T98RE
AWS_PROFILE = utu.live
.PHONY: list
list:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
clean:
@echo remove $(OUTPUTFOLDER) folder
@rm -rf $(OUTPUTFOLDER)
@echo done
install:
@echo installing depencies
npm install
@echo done
build: clean install build-dist
build-dist:
@echo build release
npm run build -- --prod
@echo done
deploy-stage:
@echo deploy S3
aws --profile $(AWS_PROFILE) s3 sync --acl public-read ./$(OUTPUTFOLDER) $(S3_STAGE_BUCKET)
aws --profile $(AWS_PROFILE) cloudfront create-invalidation --distribution-id $(CF_STAGE_DISTRIBUTION_ID) --paths '/*'
@echo "deploy S3 Staging done (wait a minute for the cache to be invalidated)"
deploy:
@echo deploy S3
aws --profile $(AWS_PROFILE) s3 sync --acl public-read ./$(OUTPUTFOLDER) $(S3_BUCKET)
aws --profile $(AWS_PROFILE) cloudfront create-invalidation --distribution-id $(CF_DISTRIBUTION_ID) --paths '/*'
@echo "deploy S3 done (wait a minute for the cache to be invalidated)"