Preparing hbase release 2.4.1RC1; tagging and updates to CHANGES.md again
[hbase.git] / dev-support / jenkins-scripts / check-website-links.sh
blob1f7cd1c1d18ed8680e655ea055163275fb26f286
1 #!/bin/bash
3 #/**
4 # * Licensed to the Apache Software Foundation (ASF) under one
5 # * or more contributor license agreements. See the NOTICE file
6 # * distributed with this work for additional information
7 # * regarding copyright ownership. The ASF licenses this file
8 # * to you under the Apache License, Version 2.0 (the
9 # * "License"); you may not use this file except in compliance
10 # * with the License. You may obtain a copy of the License at
11 # *
12 # * http://www.apache.org/licenses/LICENSE-2.0
13 # *
14 # * Unless required by applicable law or agreed to in writing, software
15 # * distributed under the License is distributed on an "AS IS" BASIS,
16 # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # * See the License for the specific language governing permissions and
18 # * limitations under the License.
19 # */
21 # This script is designed to run as a Jenkins job, such as at
22 # https://builds.apache.org/view/All/job/HBase%20Website%20Link%20Checker/
24 # It generates artifacts which the Jenkins job then can mail out and/or archive.
26 # We download a specific version of linklint because the original has bugs and
27 # is not well maintained.
29 # See http://www.linklint.org/doc/inputs.html for linklint options
31 # Clean up the workspace
32 rm -rf *.zip > /dev/null
33 rm -rf linklint > /dev/null
34 rm -Rf link_report
36 # This version of linklint fixes some bugs in the now-unmaintained 2.3.5 version
37 wget http://ingo-karkat.de/downloads/tools/linklint/linklint-2.3.5_ingo_020.zip
38 unzip linklint-2.3.5_ingo_020.zip
39 chmod +x linklint/linklint.pl
41 # Run the checker
42 echo "Checking http://hbase.apache.org and saving report to link_report/"
43 echo "Excluding /testapidocs/ because some tests use private classes not published in /apidocs/."
44 # Check internal structure
45 linklint/linklint.pl -http \
46 -host hbase.apache.org \
47 /@ \
48 -skip /testapidocs/@ \
49 -skip /testdevapidocs/@ \
50 -net \
51 -redirect \
52 -no_query_string \
53 -htmlonly \
54 -timeout 30 \
55 -delay 1 \
56 -limit 100000 \
57 -doc link_report
59 # Detect whether we had errors and act accordingly
60 if ! grep -q 'ERROR' link_report/index.html; then
61 echo "Errors found. Sending email."
62 exit 1
63 else
64 echo "No errors found. Warnings might be present."