2020-02-06 23:45:31 +00:00
|
|
|
# Default: run this if working on the website locally to run in watch mode.
|
|
|
|
website:
|
|
|
|
@echo "==> Downloading latest Docker image..."
|
|
|
|
@docker pull hashicorp/nomad-website
|
|
|
|
@echo "==> Starting website in Docker..."
|
|
|
|
@docker run \
|
|
|
|
--interactive \
|
|
|
|
--rm \
|
|
|
|
--tty \
|
|
|
|
--workdir "/website" \
|
|
|
|
--volume "$(shell pwd):/website" \
|
|
|
|
--volume "/website/node_modules" \
|
|
|
|
--publish "3000:3000" \
|
|
|
|
hashicorp/nomad-website \
|
|
|
|
npm start
|
2015-10-13 21:50:23 +00:00
|
|
|
|
2020-02-06 23:45:31 +00:00
|
|
|
# This command will generate a static version of the website to the "out" folder.
|
2017-04-06 22:37:36 +00:00
|
|
|
build:
|
2020-02-06 23:45:31 +00:00
|
|
|
@echo "==> Downloading latest Docker image..."
|
|
|
|
@docker pull hashicorp/nomad-website
|
2017-04-06 22:37:36 +00:00
|
|
|
@echo "==> Starting build in Docker..."
|
|
|
|
@docker run \
|
|
|
|
--interactive \
|
|
|
|
--rm \
|
|
|
|
--tty \
|
2020-02-06 23:45:31 +00:00
|
|
|
--workdir "/website" \
|
2017-04-06 22:37:36 +00:00
|
|
|
--volume "$(shell pwd):/website" \
|
2020-02-06 23:45:31 +00:00
|
|
|
--volume "/website/node_modules" \
|
|
|
|
hashicorp/nomad-website \
|
|
|
|
npm run static
|
2017-04-06 22:37:36 +00:00
|
|
|
|
2020-02-06 23:45:31 +00:00
|
|
|
# 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-nomad-website-local .
|
|
|
|
|
|
|
|
# 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:
|
2016-10-22 03:34:59 +00:00
|
|
|
@echo "==> Starting website in Docker..."
|
|
|
|
@docker run \
|
2017-04-06 22:37:36 +00:00
|
|
|
--interactive \
|
|
|
|
--rm \
|
2016-10-22 03:34:59 +00:00
|
|
|
--tty \
|
2020-02-06 23:45:31 +00:00
|
|
|
--workdir "/website" \
|
2016-10-22 03:34:59 +00:00
|
|
|
--volume "$(shell pwd):/website" \
|
2020-02-06 23:45:31 +00:00
|
|
|
--volume "/website/node_modules" \
|
|
|
|
--publish "3000:3000" \
|
|
|
|
hashicorp-nomad-website-local \
|
|
|
|
npm start
|
2018-10-08 18:44:23 +00:00
|
|
|
|
2020-02-06 23:45:31 +00:00
|
|
|
.DEFAULT_GOAL := website
|
|
|
|
.PHONY: build build-image website website-local
|