update make website workflow

This commit is contained in:
Dylan Staley 2021-12-16 16:10:17 -08:00
parent e22ab70e03
commit a086f0c1a5
2 changed files with 8 additions and 15 deletions

View File

@ -27,25 +27,18 @@ exhaustive:
@sh -c "'$(CURDIR)/scripts/exhaustive.sh'" @sh -c "'$(CURDIR)/scripts/exhaustive.sh'"
website: website:
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) @echo "==> Downloading latest Docker image..."
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..." @docker pull hashicorp/terraform-website:full
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
endif
$(eval WEBSITE_PATH := $(GOPATH)/src/$(WEBSITE_REPO))
@echo "==> Starting core website in Docker..." @echo "==> Starting core website in Docker..."
@docker run \ @docker run \
--interactive \ --interactive \
--rm \ --rm \
--tty \ --tty \
--publish "4567:4567" \ --workdir "/website" \
--publish "35729:35729" \ --volume "$(shell pwd):/website/ext/terraform" \
--volume "$(shell pwd)/website:/website" \ --publish "3000:3000" \
--volume "$(shell pwd):/ext/terraform" \ hashicorp/terraform-website:full \
--volume "$(WEBSITE_PATH)/content:/terraform-website" \ npm start
--volume "$(WEBSITE_PATH)/content/source/assets:/website/docs/assets" \
--volume "$(WEBSITE_PATH)/content/source/layouts:/website/docs/layouts" \
--workdir /terraform-website \
hashicorp/middleman-hashicorp:${VERSION}
# disallow any parallelism (-j) for Make. This is necessary since some # disallow any parallelism (-j) for Make. This is necessary since some
# commands during the build process create temporary files that collide # commands during the build process create temporary files that collide

View File

@ -24,7 +24,7 @@ You should preview all of your changes locally before creating a pull request. T
**Launch Site Locally** **Launch Site Locally**
1. Navigate into your local `terraform` top-level directory and run `make website`. 1. Navigate into your local `terraform` top-level directory and run `make website`.
1. Open `http://localhost:4567` in your web browser. While the preview is running, you can edit pages and Next.js will automatically rebuild them. 1. Open `http://localhost:3000` in your web browser. While the preview is running, you can edit pages and Next.js will automatically rebuild them.
1. When you're done with the preview, press `ctrl-C` in your terminal to stop the server. 1. When you're done with the preview, press `ctrl-C` in your terminal to stop the server.
## Deploying Changes ## Deploying Changes