Merge pull request #4762 from hashicorp/f-678-check-broken-links

docs: check website for broken links
This commit is contained in:
Chris Baker
2018-10-09 16:35:06 -04:00
committed by GitHub
7 changed files with 43 additions and 5 deletions

View File

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

View File

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

View File

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

24
website/scripts/test.sh Executable file
View File

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

View File

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

View File

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

View File

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