packer-cn/website/Makefile

55 lines
1.6 KiB
Makefile
Raw Normal View History

2020-03-18 18:46:47 -04:00
# Default: run this if working on the website locally to run in watch mode.
website:
@echo "==> Downloading latest Docker image..."
2020-10-29 14:05:41 -04:00
@docker pull docker.mirror.hashicorp.services/hashicorp/packer-website
2020-03-18 18:46:47 -04:00
@echo "==> Starting website in Docker..."
@docker run \
--interactive \
--rm \
--tty \
--workdir "/website" \
--volume "$(shell pwd):/website" \
--volume "/website/node_modules" \
--publish "3000:3000" \
hashicorp/packer-website \
npm start
2017-03-08 14:22:54 -05:00
2020-03-18 18:46:47 -04:00
# This command will generate a static version of the website to the "out" folder.
build:
@echo "==> Downloading latest Docker image..."
2020-10-29 14:05:41 -04:00
@docker pull docker.mirror.hashicorp.services/hashicorp/packer-website
2017-04-06 18:16:02 -04:00
@echo "==> Starting build in Docker..."
@docker run \
--interactive \
--rm \
--tty \
2020-03-18 18:46:47 -04:00
--workdir "/website" \
--volume "$(shell pwd):/website" \
--volume "/website/node_modules" \
2020-10-29 14:05:41 -04:00
docker.mirror.hashicorp.services/hashicorp/packer-website \
2020-03-18 18:46:47 -04:00
npm run static
# If you are changing node dependencies locally, run this to generate a new
# local Docker image with the dependency changes included.
build-image:
@echo "==> Building Docker image..."
@docker build -t hashicorp-packer-website-local .
2017-04-06 18:16:02 -04:00
2020-03-18 18:46:47 -04:00
# Use this if you have run `build-image` to use the locally built image
# rather than our CI-generated image to test dependency changes.
website-local:
2017-03-08 14:22:54 -05:00
@echo "==> Starting website in Docker..."
@docker run \
2017-04-06 18:16:02 -04:00
--interactive \
--rm \
2017-03-08 14:22:54 -05:00
--tty \
2020-03-18 18:46:47 -04:00
--workdir "/website" \
--volume "$(shell pwd):/website" \
--volume "/website/node_modules" \
--publish "3000:3000" \
hashicorp-packer-website-local \
npm start
2017-03-08 14:22:54 -05:00
2020-03-18 18:46:47 -04:00
.DEFAULT_GOAL := website
.PHONY: build build-image website website-local