forked from hashicorp/terraform-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
81a591c
commit 328861c
Showing
1 changed file
with
8 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
$(MAKE) -C website website/build-local |