corso/website/Makefile
Niraj Tolia b0735e2ed1
Add a make clean step for the website (#1441)
## Description

`make clean` will now be executed before a Docker image is built. While it technically has no impact on the Docker image, it will ensure that there are no stale Node modules lying around when a build is executed after the creation of a new image.

While running a Docker build without a cache is an additional option, it does not prevent stale local node_modules directories and suffers from the overhead of having to pull down a large Ubuntu base image every time.

## Type of change

- [x] 🐛 Bugfix
2022-11-04 08:06:02 +00:00

29 lines
673 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
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