From 2de5e147acb93f5b4243fc83fa01bca5ba530b6a Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Thu, 21 Feb 2019 08:52:30 -0700 Subject: [PATCH] Makefile override bind (#3319) * Permit override of the serve domain When I use `serve` I serve from a remote server. I have hand modified the Makefile for ages to allow me to override the serve location so that hugo renders and links the site properly. Document how to do this and encode it within the Makefile. * Clean up expectations --- Makefile | 5 ++++- README.md | 10 ++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9d724ab064..663879d440 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +ISTIO_SERVE_DOMAIN ?= localhost +export ISTIO_SERVE_DOMAIN + img := gcr.io/istio-testing/website-builder:2019-02-13 docker := docker run -e INTERNAL_ONLY=true -t -i --sig-proxy=true --rm -v $(shell pwd):/site -w /site $(img) @@ -19,7 +22,7 @@ lint: $(docker) scripts/lint_site.sh serve: - docker run -t -i --sig-proxy=true --rm -v $(shell pwd):/site -w /site -p 1313:1313 $(img) hugo serve --baseURL "http://localhost:1313/" --bind 0.0.0.0 --disableFastRender + docker run -t -i --sig-proxy=true --rm -v $(shell pwd):/site -w /site -p 1313:1313 $(img) hugo serve --baseURL "http://${ISTIO_SERVE_DOMAIN}:1313/" --bind 0.0.0.0 --disableFastRender netlify: scripts/gen_site.sh "$(baseurl)" diff --git a/README.md b/README.md index 9509fd5504..f462152805 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,16 @@ $ make serve This will build the site and start a web server hosting the site. You can then connect to the web server at `http://localhost:1313`. +To make and serve the site from a remote server, override `ISTIO_SERVE_DOMAIN` as follows with the IP address +or DNS Domain of the server as follows: + +```bash +$ export ISTIO_SERVE_DOMAIN=192.168.7.105 +$ make serve +``` +This will build the site and start a web server hosting the site. You can then connect to the web server +at `http://192.168.7.105:1313`. + All normal content for the site is located in the `content` directory, as well as in sibling translated directories such as content_zh.