From b0735e2ed1b49fbe5f157a23c0679ac0c0ef0c17 Mon Sep 17 00:00:00 2001 From: Niraj Tolia Date: Fri, 4 Nov 2022 01:06:02 -0700 Subject: [PATCH] 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] :bug: Bugfix --- website/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/website/Makefile b/website/Makefile index aa88b9b19..a7172e277 100644 --- a/website/Makefile +++ b/website/Makefile @@ -1,9 +1,9 @@ -.PHONY: buildimage dev shell build publish sync +.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: +buildimage: clean docker build -t "corso/website:latest" . dev: @@ -23,3 +23,6 @@ publish: build 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