corso/website/Makefile
Abin Simon 2e33f37cee
CI for website (#1469)
## Description

CI for website, useful for dependabot tests.

## 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

Co-authored-by: Vaibhav Kamra <vkamra@alcion.ai>
2022-11-15 11:10:53 +05:30

34 lines
849 B
Makefile

.PHONY: buildimage dev shell build publish sync clean
WEBC := docker run --rm -it --init -p 5050:3000 -p 5051:3001 \
-v ${PWD}:/usr/src/website corso/website:latest
ifeq (${CI},true)
# Cannot run in interactive/tty mode in CI
WEBC := docker run --rm --init -p 5050:3000 -p 5051:3001 \
-v ${PWD}:/usr/src/website corso/website:latest
endif
buildimage: clean
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:latest \
make sync
sync:
aws s3 sync /usr/src/website/dist/ s3://corsobackup.io/ --exclude ".git/*" --delete
aws cloudfront create-invalidation --distribution-id E1W9NGI9YTVZ1A --paths "/*"
clean:
rm -rf node_modules