From 328861c782b6cb4490d04e65c4f580b888ce469b Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Thu, 20 Oct 2022 11:58:12 -0400 Subject: [PATCH] chore: update root `Makefile` --- Makefile | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index cec4c6f1ad..d0460c29fb 100644 --- a/Makefile +++ b/Makefile @@ -1,33 +1,16 @@ -PWD=$$(pwd) -DOCKER_IMAGE="hashicorp/terraform-website:full" -DOCKER_IMAGE_LOCAL="terraform-website-local" -DOCKER_RUN_FLAGS=--interactive \ - --rm \ - --tty \ - --volume "$(shell pwd)/website:/website/preview" \ - --publish "3000:3000" \ - -e "IS_CONTENT_PREVIEW=true" \ - -e "PREVIEW_FROM_REPO=terraform-cdk" \ - -e "NAV_DATA_DIRNAME=./preview/data" \ - -e "CONTENT_DIRNAME=./preview/docs" \ - -e "CURRENT_GIT_BRANCH=$$(git rev-parse --abbrev-ref HEAD)" +.DEFAULT_GOAL := website # Default: run this if working on the website locally to run in watch mode. +.PHONY: website website: - @echo "==> Downloading latest Docker image..." - @docker pull ${DOCKER_IMAGE} - @echo "==> Starting website in Docker..." - @docker run ${DOCKER_RUN_FLAGS} ${DOCKER_IMAGE} npm start + $(MAKE) -C website website +# Use this if you have run `website/build-local` to use the locally built image. +.PHONY: website/local website/local: - @echo "==> Starting website in Docker..." - @docker run ${DOCKER_RUN_FLAGS} ${DOCKER_IMAGE_LOCAL} npm start + $(MAKE) -C website website/local +# Run this to generate a new local Docker image. .PHONY: website/build-local website/build-local: - @echo "==> Building local Docker image" - @docker build https://github.com/hashicorp/terraform-website.git\#master \ - -t $(DOCKER_IMAGE_LOCAL) - -.DEFAULT_GOAL := website -.PHONY: website website/local website/build-local \ No newline at end of file + $(MAKE) -C website website/build-local \ No newline at end of file