diff --git a/.deadlink b/.deadlink new file mode 100644 index 000000000..b9417780c --- /dev/null +++ b/.deadlink @@ -0,0 +1,25 @@ +directories: + - "./" +fileExtensions: + - ".md" + - ".rst" +goldenURL: "https://google.com" +ignored: + - "https://google.com" + - "http://username:password@host:port" + - "https://10.23.25.101:6443" + - "https://10.23.25.102:6443" + - "http://10.0.4.4/identity" + - "http://192.168.122.10:8000/redfish/v1/Systems" + - "http://192.168.122.10:8000/redfish/v1/Systems/8e5b2dc4-0c1d-4509-af2f-7a4a8f2121a8" + - "http://localhost/mini.iso" + - "http://localhost/mini.iso" + - "http://localhost:8000/" + - "http://localhost:8000/redfish/v1/Managers/58893887-894-2487-2389-841168418919/VirtualMedia/Cd" + - "http://localhost:8000/redfish/v1/Managers/58893887-894-2487-2389-841168418919/VirtualMedia/Cd/Actions/VirtualMedia.InsertMedia-" + - "http://localhost:8000/redfish/v1/Systems/" + - "http://localhost:8000/redfish/v1/Systems/47a3b9a3-3967-4d23-98d8-18de1c28e94f" + - "http://localhost:8000/redfish/v1/Systems/47a3b9a3-3967-4d23-98d8-18de1c28e94f" + - "http://localhost:8000/redfish/v1/Systems/47a3b9a3-3967-4d23-98d8-18de1c28e94f/Actions/ComputerSystem.Reset" +maxFailures: 0 +logVerbosity: 0 diff --git a/Makefile b/Makefile index 7e851c90f..4cda9f1cf 100644 --- a/Makefile +++ b/Makefile @@ -373,6 +373,11 @@ check-copyright: validate-docs: @./tools/validate_docs +# Validate all URL references in documentation work +.PHONY: dead-link-linter +dead-link-linter: + @./tools/dead-link-linter + # Generate code generate: controller-gen $(CONTROLLER_GEN) object:headerFile="tools/license_go.txt" paths="./..." diff --git a/playbooks/airship-airshipctl-dead-link-linter.yaml b/playbooks/airship-airshipctl-dead-link-linter.yaml new file mode 100644 index 000000000..e7e9648ea --- /dev/null +++ b/playbooks/airship-airshipctl-dead-link-linter.yaml @@ -0,0 +1,20 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- hosts: primary + tasks: + - name: Run Auxiliary Linter + block: + - name: "make dead-link-linter" + make: + chdir: "{{ zuul.project.src_dir }}" + target: dead-link-linter diff --git a/tools/dead-link-linter b/tools/dead-link-linter new file mode 100755 index 000000000..b2324a9e3 --- /dev/null +++ b/tools/dead-link-linter @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +set -xe + +: "${LINTER_VERSION:="1.0.3"}" +: "${OS_TYPE:="linux"}" +: "${ARCHITECTURE:="amd64"}" + +URL="https://github.com/DannyMassa/dead-link-linter/releases/download/${LINTER_VERSION}/dead-link-linter-${LINTER_VERSION}-${OS_TYPE}-${ARCHITECTURE}.tar.gz" +TAR_BALL="dead-link-linter-${LINTER_VERSION}-${OS_TYPE}-${ARCHITECTURE}.tar.gz" + +wget ${URL} +tar -xvf ${TAR_BALL} +./dead-link-linter + +status=$? +[ $status -eq 0 ] && \ + echo "Dead Link Linter Passed" && \ + rm ${TAR_BALL} && \ + rm dead-link-linter && \ + exit 0 \ + || \ + echo "Dead Link Linter Failed" && \ + rm ${TAR_BALL} && \ + rm dead-link-linter && \ + exit 1 diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 3b8864c9c..64a5c4251 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -49,6 +49,13 @@ nodeset: airship-airshipctl-single-node voting: false +- job: + name: airship-airshipctl-dead-link-linter + description: Ensures all URLs referenced in documentation are still working + run: playbooks/airship-airshipctl-dead-link-linter.yaml + nodeset: airship-airshipctl-single-node + voting: false + - job: name: airship-airshipctl-build-image nodeset: airship-airshipctl-single-node diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml index 16553038c..13f4ec58b 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/projects.yaml @@ -42,6 +42,7 @@ - airship-airshipctl-gate-script-runner-docker - airship-aiap-build-image - airship-airship-in-a-pod-script-runner + - airship-airshipctl-dead-link-linter experimental: jobs: - airship-airshipctl-docker-kubebench-conformance