diff --git a/.travis.yml b/.travis.yml index 7b2855581..dc79d5738 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,10 @@ matrix: dist: trusty sudo: required env: ENABLE_RACE=1 + - os: linux + dist: trusty + sudo: false + env: RUN_WEBSITE_TESTS=1 SKIP_NOMAD_TESTS=1 - os: linux dist: trusty sudo: false diff --git a/GNUmakefile b/GNUmakefile index 6ff23c8d6..d337b46da 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -237,6 +237,9 @@ test: ## Run the Nomad test suite and/or the Nomad UI test suite @if [ ! $(SKIP_NOMAD_TESTS) ]; then \ make test-nomad; \ fi + @if [ $(RUN_WEBSITE_TESTS) ]; then \ + make test-website; \ + fi @if [ $(RUN_UI_TESTS) ]; then \ make test-ui; \ fi @@ -297,6 +300,10 @@ static-assets: ## Compile the static routes to serve alongside the API @go-bindata-assetfs -pkg agent -prefix ui -modtime 1480000000 -tags ui -o bindata_assetfs.go ./ui/dist/... @mv bindata_assetfs.go command/agent +.PHONY: test-webiste +test-website: ## Run Website Link Checks + @cd website && make test + .PHONY: test-ui test-ui: ## Run Nomad UI test suite @echo "--> Installing JavaScript assets" diff --git a/website/Makefile b/website/Makefile index 7497725e4..e92e090a0 100644 --- a/website/Makefile +++ b/website/Makefile @@ -22,4 +22,8 @@ website: --volume "$(shell pwd):/website" \ hashicorp/middleman-hashicorp:${VERSION} +test: + @echo "==> Running website tests..." + ./scripts/test.sh ${VERSION} + .PHONY: build website diff --git a/website/scripts/test.sh b/website/scripts/test.sh new file mode 100755 index 000000000..196f094fc --- /dev/null +++ b/website/scripts/test.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -e + +# passed in from outer makefile, default to 0.3.35 +MMVERSION=${1-0.3.35} + +echo "Running website in container..." +WEBSITE_CID=$(docker run \ + --detach \ + --rm \ + --publish "4567:4567" \ + --publish "35729:35729" \ + --volume "$PWD:/website" \ + hashicorp/middleman-hashicorp:${MMVERSION}) +echo "Website is launching in container ${WEBSITE_CID}." + +echo "Checking website for dead links using recursive wget..." +wget -nv --recursive --level=10 --delete-after http://localhost:4567 && exit_code=$? || exit_code=$? +echo "wget exit code: ${exit_code}" + +echo "Killing docker website container ${WEBSITE_CID}..." +docker kill ${WEBSITE_CID} || true + +exit ${exit_code} diff --git a/website/source/docs/runtime/index.html.md b/website/source/docs/runtime/index.html.md index b7af10a21..2cb4abf45 100644 --- a/website/source/docs/runtime/index.html.md +++ b/website/source/docs/runtime/index.html.md @@ -17,4 +17,4 @@ one of the options below: - [Environment](/docs/runtime/environment.html) - [Interpolation](/docs/runtime/interpolation.html) -- [Schedulers](/docs/runtime/schedulers.html) +- [Schedulers](/docs/schedulers.html) diff --git a/website/source/guides/load-balancing/fabio.html.md b/website/source/guides/load-balancing/fabio.html.md index 949f6dce8..e74537053 100644 --- a/website/source/guides/load-balancing/fabio.html.md +++ b/website/source/guides/load-balancing/fabio.html.md @@ -230,4 +230,4 @@ the web interface at port `9998`, you should be able to access that as well. [lb-homepage]: /assets/images/lb-homepage.png [lb-routing-table]: /assets/images/lb-routing-table.png [routing-table]: /assets/images/routing-table.png -[system]: /docs/runtime/schedulers.html#system +[system]: /docs/schedulers.html#system diff --git a/website/source/intro/getting-started/ui.html.md b/website/source/intro/getting-started/ui.html.md index 1c3224f80..7fdf40b95 100644 --- a/website/source/intro/getting-started/ui.html.md +++ b/website/source/intro/getting-started/ui.html.md @@ -17,7 +17,7 @@ a job in the web client. As long as Nomad is running, the Nomad UI is also running. It is hosted at the same address and port as the Nomad HTTP API under the `/ui` namespace. -With Nomad running, visit [http://localhost:4646](http://localhost:4646) to open the Nomad UI. +With Nomad running, visit `http://localhost:4646` to open the Nomad UI. [![Nomad UI Jobs List][img-jobs-list]][img-jobs-list] @@ -29,8 +29,7 @@ port mapping: ==> default: Fixed port collision for 4646 => 4646. Now on port 2200. ``` -In the case above you would connect to -[http://localhost:2200](http://localhost:2200) instead. +In the case above you would connect to `http://localhost:2200` instead. ## Inspecting a Job