Skip to content

Commit

Permalink
Merge "Adding dead-link-linter gate"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Nov 18, 2021
2 parents 72cfb01 + f9ae261 commit ebc1589
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .deadlink
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
directories:
- "./"
fileExtensions:
- ".md"
- ".rst"
goldenURL: "https://google.com"
ignored:
- "https://google.com"
maxFailures: 0
logVerbosity: 1
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ build_docs:
format:
tox -e fmt

# Validate all URL references in documentation work
.PHONY: dead-link-linter
dead-link-linter:
@./tools/dead-link-linter
20 changes: 20 additions & 0 deletions playbooks/airship-treasuremap-dead-link-linter.yaml
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions tools/dead-link-linter
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/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
7 changes: 7 additions & 0 deletions zuul.d/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,10 @@
- ^manifests/type/multi-tenant/.*$
- ^manifests/function/.*$
- ^manifests/composite/.*$

- job:
name: airship-treasuremap-dead-link-linter
description: Ensures all URLs referenced in documentation are still working
run: playbooks/airship-treasuremap-dead-link-linter.yaml
nodeset: airship-treasuremap-single-node
voting: false
4 changes: 3 additions & 1 deletion zuul.d/projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
check:
jobs:
- airship-treasuremap-validate-site-docs
# - airship-treasuremap-functional-existing-k8s TODO: Enable this when functional tests exist, and a cluster is up
- airship-treasuremap-deploy-virtual-airship-core
- airship-treasuremap-dead-link-linter
# - airship-treasuremap-functional-existing-k8s TODO: Enable this when functional tests exist, and a cluster is up
gate:
jobs:
- noop
- airship-treasuremap-validate-site-docs
- airship-treasuremap-deploy-virtual-airship-core
- airship-treasuremap-dead-link-linter
# - airship-treasuremap-functional-existing-k8s TODO: Enable this when functional tests exist, and a cluster is up
experimental:
jobs:
Expand Down

0 comments on commit ebc1589

Please sign in to comment.