Maintenance notification: GitLab and all corresponding services will be down for maintenance from Thursday, June 24th 16:00 until Friday, June 25th 08:00. Please excuse the inconvenience and plan your work accordingly.

Commit 22942e3b authored by Huste, Tobias (FWCC) - 111645's avatar Huste, Tobias (FWCC) - 111645 Committed by Huste, Tobias (FWCC) - 111645
Browse files

Fix external link checking

parent c43d313c
......@@ -77,9 +77,6 @@ stages:
stage: test
variables:
<<: *common_variables
HTMLPROOFER_VERSION: 3.13.0
YAMLLINT_VERSION: 0.0.7
GIT_STRATEGY: none
before_script:
# Installing, generating and exporting locale because htmlproofer needs it.
# Locale is not set in "standard" docker containers.
......@@ -91,15 +88,15 @@ stages:
export LANG=en_US.UTF-8 && \
export LANGUAGE=en_US:en && \
export LC_ALL=en_US.UTF-8"
- gem install html-proofer -v $HTMLPROOFER_VERSION --no-document
- gem install yaml-lint -v $YAMLLINT_VERSION --no-document
- gem install bundler --no-document
- bundle install --jobs $(nproc)
script:
- "htmlproofer \
- "bundle exec htmlproofer \
--internal-domains localhost:4000 \
--disable-external \
--assume-extension public/"
# Use yaml-lint tool to check yaml files.
- "yaml-lint _data/ _config.yml"
- "bundle exec yaml-lint _data/ _config.yml"
<<: *cache_production
# https://docs.gitlab.com/ce/ci/yaml/#interruptible
interruptible: true
......@@ -158,13 +155,9 @@ test:htmlproofer:subpath:
# Job tests external links in addition to test:htmlproofer job.
test:htmlproofer:external_links:
<<: *tests
dependencies:
- build:production
needs: ["build:production"]
needs: []
script:
- "htmlproofer \
--internal-domains localhost:4000 \
--assume-extension public/"
- "bundle exec rake test_external_links"
only:
- schedules
tags:
......
require 'html-proofer'
task :test_external_links do
sh "bundle exec jekyll build"
options = {
:assume_extension => true,
:external_only => true,
:file_ignore => [/\.\/_site\/assets\/vendor\/.*/,],
:typhoeus => {
:headers => { "User-Agent" => "Mozilla/5.0 Firefox/84.0" }
}
}
HTMLProofer.check_directory("./_site", options).run
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment