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
This commit is contained in:
Steven Dake 2019-02-21 08:52:30 -07:00 committed by Martin Taillefer
parent 96c8cbadd6
commit 2de5e147ac
2 changed files with 14 additions and 1 deletions

View File

@ -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)"

View File

@ -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.