## Description This makes it so that we have an option to locally run all Makefile targets without having to go through Docker. That said, it retains Docker as the default way to run it, but now we can set an evn variable `CORSO_USE_DOCKER=-1` to skip running through docker. I understand if this looks a bit hacky and don't want to add it in, but thought I wold propose this anyways. While not major, I was able to get a good amount of decrease in build times. ## Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Test - [x] 💻 CI/Deployment - [ ] 🐹 Trivial/Minor ## Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * #<issue> ## Test Plan <!-- How will this be tested prior to merging.--> - [x] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
29 lines
654 B
Makefile
29 lines
654 B
Makefile
.PHONY: buildimage dev shell build publish sync
|
|
|
|
WEBC := docker run --rm -it --init -p 5050:3000 -p 5051:3001 \
|
|
-v ${PWD}:/usr/src/website corso/website
|
|
ifeq (${CORSO_USE_DOCKER},-1)
|
|
WEBC :=
|
|
endif
|
|
|
|
buildimage:
|
|
docker build -t "corso/website:latest" .
|
|
|
|
dev:
|
|
$(WEBC) gulp
|
|
|
|
shell:
|
|
$(WEBC) /bin/bash
|
|
|
|
build:
|
|
$(WEBC) gulp build
|
|
|
|
publish: build
|
|
docker run -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY \
|
|
-e AWS_SESSION_TOKEN --rm -v ${PWD}:/usr/src/website corso/website \
|
|
make sync
|
|
|
|
sync:
|
|
aws s3 sync /usr/src/website/dist/ s3://corsobackup.io/ --exclude ".git/*" --delete
|
|
aws cloudfront create-invalidation --distribution-id XXXXX --paths "/*"
|