-
Notifications
You must be signed in to change notification settings - Fork 58
/
website-tester.sh
executable file
·77 lines (67 loc) · 2.34 KB
/
website-tester.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
declare -i result
echo "::group::mvn install"
mvn --batch-mode install
echo "::endgroup::"
echo "::group::mvn site"
mvn --batch-mode site site:stage </dev/null
echo "::endgroup::"
echo "::group::tar"
tar -C /tmp/website/html --strip-components 1 \
-xpf yetus-dist/target/artifacts/apache-yetus-*-site.tar.gz
find /tmp/website/html/* -type d | sort
if [[ ! -d /tmp/website/html/documentation/in-progress/ ]]; then
echo ::error javadoc is missing from tar file
exit 1
fi
echo "::endgroup::"
echo "::group::start apache httpd"
apache2
echo "::endgroup::"
echo "::group::linkchecker"
linkchecker --config .linkcheckerrc http://localhost:8123
result=$?
echo "::endgroup::"
echo "::group::codespell releasenotes"
codespell \
--disable-colors \
--interactive 0 \
--quiet-level 34 \
./asf-site-src/source/downloads/releasenotes \
| sed -e 's,^./,,g' \
> /tmp/codespell.txt
while read -r; do
filename=$(echo "${REPLY}" | cut -f1 -d:)
line=$(echo "${REPLY}" | cut -f2 -d:)
msg=$(echo "${REPLY}" | cut -f3 -d:)
echo "::error file=${filename},line=${line}:: codespell: ${msg}"
done < /tmp/codespell.txt
echo "::endgroup::"
#
# urlname;parentname;base;result;warningstring;infostring;valid;url;line;column;name;dltime;size;checktime;cached;level;modified
# in-page reference: $1
# generated page: $2
# error code: $4
# expected page: $8
#
echo "::group::github actions check annotations"
grep -v '^#' linkchecker-out.csv \
| grep -v '^urlname' \
| awk '-F;' \
'{print "::error::["$4"] mdref: ("$1") | pageref: "$2" | expected page: "$8}'
echo "::endgroup::"
exit ${result}