diff options
Diffstat (limited to 'buildbot/linkchecker.sh')
-rwxr-xr-x | buildbot/linkchecker.sh | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/buildbot/linkchecker.sh b/buildbot/linkchecker.sh index 2b24f7c..24c90a0 100755 --- a/buildbot/linkchecker.sh +++ b/buildbot/linkchecker.sh @@ -1,11 +1,14 @@ #!/bin/bash - +#set -v # Removed because wget errors with error 8 (Server issued an error response.) #set -e ## This script will scan www.taler.net for broken links and e-mail a copy of the log if any are found. -logfile="linkchecker.log" +logfile="$HOME/linkchecker.log" +wait_time="1" +recurse_level="1" +ignore_list="(.*)demo.taler.net(.*)\/orders\/(.*)" # appears to do *nothing* # Remove old log @@ -17,20 +20,21 @@ if [ -f "$logfile" ] echo "Info: existing log file '$logfile' not found." fi -# Use wget to scan www.taler.net and save output - -echo -echo "Running this command:" -echo " wget --spider -r -nd -nv -H -l 1 -w 2 -o $logfile https://www.taler.net/" -wget --spider -r -nd -nv -H -l 1 -w 2 -o $logfile https://www.taler.net/ +podman build -t linkchecker:latest -f "$HOME/deployment/buildbot/linkchecker.Containerfile" "$HOME/deployment/buildbot" -# display logfile -echo -echo "Displaying contents of logfile" -cat $logfile +# Use wget to scan hosts and save output +for url in "https://www.taler.net/" "https://docs.taler.net/" "https://taler-systems.com/" "https://demo.taler.net/" "https://bank.demo.taler.net/" "https://shop.demo.taler.net/" "https://donations.demo.taler.net/" ; do + echo -e "\n\n#############################\n## Starting check on ${url}\n#############################\n" + podman run --rm localhost/linkchecker:latest \ + linkchecker \ + --no-robots \ + --check-extern \ + --recursion-level="$recurse_level" \ + "$url" | tee --append "$logfile" +done # Search the log for the phrase "broken link" as this is what wget will report -if grep -iRl 'broken link!!' $logfile +if grep -Rl 'Error' $logfile then echo "Found broken links. Build should fail (exit 1), triggering e-mail notification." exit 1 |