Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dev): add networking overrides to website Makefile #18655

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions website/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
CUE = ./scripts/cue.sh

# Override to specify which network address to use in Hugo/HTTP servers for binding
export SERVER_BIND ?= 127.0.0.1
# Override to specify which port to use in Hugo/HTTP servers for listening
export SERVER_PORT ?= 1313

clean:
rm -rf public resources data/docs.json

Expand Down Expand Up @@ -33,6 +38,8 @@ structured-data: cue-build config-examples

serve: clean setup structured-data
hugo server \
--bind $(SERVER_BIND) \
--port $(SERVER_PORT) \
--buildDrafts \
--buildFuture \
--environment "development"
Expand All @@ -48,7 +55,7 @@ ci-production-build: setup structured-data production-build run-link-checker alg
# Preview site
preview-build:
hugo \
--baseURL $(DEPLOY_PRIME_URL) \
$(if $(DEPLOY_PRIME_URL),--baseURL $(DEPLOY_PRIME_URL),) \
--buildFuture \
--environment "preview" \
--minify
Expand All @@ -74,7 +81,7 @@ algolia:
# Useful for locally debugging issues that arise only on the deployed production site
run-production-site-locally:
make setup structured-data production-build
python3 -m http.server 1313 --directory ./public --bind 127.0.0.1
python3 -m http.server $(SERVER_PORT) --bind $(SERVER_BIND) --directory ./public

# Local dev build with no link checking and no Yarn dependency fetching
quick-build: clean structured-data production-build
Expand Down