From 39f55d350b39754ead562120ec0b84a975b9fc43 Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Mon, 8 Oct 2018 13:23:14 -0400 Subject: [PATCH 1/8] docs: fixed broken links to schedulers page --- website/source/docs/runtime/index.html.md | 2 +- website/source/guides/load-balancing/fabio.html.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 From 71edab44c4c19203ba6fb172399b59f82d7f7860 Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Mon, 8 Oct 2018 14:42:33 -0400 Subject: [PATCH 2/8] docs: changed localhost URLs for local UI from hyperlinks to pre-text, they were interfering with bad link detection --- website/source/intro/getting-started/ui.html.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 From 99beb3ed4c1250856f8521d9a399b856782a234f Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Mon, 8 Oct 2018 14:44:23 -0400 Subject: [PATCH 3/8] docs: added docs website tests using a simple wget --recursive --- .travis.yml | 2 +- GNUmakefile | 7 +++++++ website/Makefile | 4 ++++ website/scripts/test.sh | 17 +++++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 website/scripts/test.sh diff --git a/.travis.yml b/.travis.yml index 7b2855581..108a37b1e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ matrix: - os: linux dist: trusty sudo: false - env: RUN_UI_TESTS=1 SKIP_NOMAD_TESTS=1 + env: RUN_UI_TESTS=1 RUN_WEBSITE_CHECKS=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..2dfa53ed1 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 + .PHONY: build website diff --git a/website/scripts/test.sh b/website/scripts/test.sh new file mode 100755 index 000000000..a6478668e --- /dev/null +++ b/website/scripts/test.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -e + +MMVERSION=${1-0.3.35} + +WEBSITE_CID=$(docker run \ + --detach \ + --rm \ + --publish "4567:4567" \ + --publish "35729:35729" \ + --volume "$PWD:/website" \ + hashicorp/middleman-hashicorp:${MMVERSION}) + +trap 'echo Killing docker website container... && docker kill ${WEBSITE_CID}' EXIT HUP INT QUIT TERM + +echo Checking website for dead links... +wget --recursive --delete-after http://localhost:4567 From b592f01a9f0984471866a127c0595b6c71c7378b Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Mon, 8 Oct 2018 14:54:40 -0400 Subject: [PATCH 4/8] docs: fixed incorrect env var in travis that to enable website testing --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 108a37b1e..0114ad0cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ matrix: - os: linux dist: trusty sudo: false - env: RUN_UI_TESTS=1 RUN_WEBSITE_CHECKS=1 SKIP_NOMAD_TESTS=1 + env: RUN_UI_TESTS=1 RUN_WEBSITE_TESTS=1 SKIP_NOMAD_TESTS=1 - os: linux dist: trusty sudo: false From 2566a81f12ca082ac56a42e602ade9791c1a1041 Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Mon, 8 Oct 2018 15:02:15 -0400 Subject: [PATCH 5/8] docs: modified docs wget testing to be a little less verbose --- website/scripts/test.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/website/scripts/test.sh b/website/scripts/test.sh index a6478668e..c24fc6582 100755 --- a/website/scripts/test.sh +++ b/website/scripts/test.sh @@ -3,6 +3,7 @@ set -e MMVERSION=${1-0.3.35} +echo Running website in container... WEBSITE_CID=$(docker run \ --detach \ --rm \ @@ -10,8 +11,9 @@ WEBSITE_CID=$(docker run \ --publish "35729:35729" \ --volume "$PWD:/website" \ hashicorp/middleman-hashicorp:${MMVERSION}) +echo Website running in container ${WEBSITE_CID}. trap 'echo Killing docker website container... && docker kill ${WEBSITE_CID}' EXIT HUP INT QUIT TERM -echo Checking website for dead links... -wget --recursive --delete-after http://localhost:4567 +echo Checking website for dead links using recursive wget... +wget -nv --recursive --level=10 --delete-after http://localhost:4567 From 73fc429fcc7fda343716e9c8514c193bb8bc96fa Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Mon, 8 Oct 2018 15:11:46 -0400 Subject: [PATCH 6/8] docs: broke docs testing out into its own travis stage --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0114ad0cf..dc79d5738 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,11 @@ matrix: - os: linux dist: trusty sudo: false - env: RUN_UI_TESTS=1 RUN_WEBSITE_TESTS=1 SKIP_NOMAD_TESTS=1 + env: RUN_WEBSITE_TESTS=1 SKIP_NOMAD_TESTS=1 + - os: linux + dist: trusty + sudo: false + env: RUN_UI_TESTS=1 SKIP_NOMAD_TESTS=1 - os: linux dist: trusty sudo: false From 0f2247b7aba44e5aaa39f7789d90b59fc58aee9a Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Tue, 9 Oct 2018 15:28:46 -0400 Subject: [PATCH 7/8] website testing: minor formatting changes, passing in middleman version from outer Makefile --- website/Makefile | 2 +- website/scripts/test.sh | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/website/Makefile b/website/Makefile index 2dfa53ed1..e92e090a0 100644 --- a/website/Makefile +++ b/website/Makefile @@ -24,6 +24,6 @@ website: test: @echo "==> Running website tests..." - ./scripts/test.sh + ./scripts/test.sh ${VERSION} .PHONY: build website diff --git a/website/scripts/test.sh b/website/scripts/test.sh index c24fc6582..aef25bfc0 100755 --- a/website/scripts/test.sh +++ b/website/scripts/test.sh @@ -1,9 +1,10 @@ #!/bin/bash set -e +# passed in from outer makefile, default to 0.3.35 MMVERSION=${1-0.3.35} -echo Running website in container... +echo "Running website in container..." WEBSITE_CID=$(docker run \ --detach \ --rm \ @@ -11,9 +12,9 @@ WEBSITE_CID=$(docker run \ --publish "35729:35729" \ --volume "$PWD:/website" \ hashicorp/middleman-hashicorp:${MMVERSION}) -echo Website running in container ${WEBSITE_CID}. +echo "Website running in container ${WEBSITE_CID}." trap 'echo Killing docker website container... && docker kill ${WEBSITE_CID}' EXIT HUP INT QUIT TERM -echo Checking website for dead links using recursive wget... +echo "Checking website for dead links using recursive wget..." wget -nv --recursive --level=10 --delete-after http://localhost:4567 From e3bcb8218e95918695e773a0169648c71df50166 Mon Sep 17 00:00:00 2001 From: Chris Baker Date: Tue, 9 Oct 2018 16:06:12 -0400 Subject: [PATCH 8/8] website testing: swapped out trap in website testing script for a simpler error catch --- website/scripts/test.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/website/scripts/test.sh b/website/scripts/test.sh index aef25bfc0..196f094fc 100755 --- a/website/scripts/test.sh +++ b/website/scripts/test.sh @@ -12,9 +12,13 @@ WEBSITE_CID=$(docker run \ --publish "35729:35729" \ --volume "$PWD:/website" \ hashicorp/middleman-hashicorp:${MMVERSION}) -echo "Website running in container ${WEBSITE_CID}." - -trap 'echo Killing docker website container... && docker kill ${WEBSITE_CID}' EXIT HUP INT QUIT TERM +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 +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}