Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/post-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
- author
- bats
- checkstyle
- docs
- findbugs
- rat
- unit
Expand All @@ -93,7 +94,7 @@ jobs:
maven-repo-${{ hashFiles('**/pom.xml') }}-8
maven-repo-${{ hashFiles('**/pom.xml') }}
maven-repo-
if: ${{ !contains('author,bats', matrix.check) }}
if: ${{ !contains('author,bats,docs', matrix.check) }}
- name: Execute tests
run: hadoop-ozone/dev-support/checks/${{ matrix.check }}.sh
- name: Summary of failures
Expand Down
28 changes: 28 additions & 0 deletions hadoop-ozone/dev-support/checks/_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,34 @@ _install_flekszible() {
chmod +x bin/flekszible
}

install_hugo() {
_install_tool hugo bin
}

_install_hugo() {
: ${HUGO_VERSION:=0.81.0}

local os=$(uname -s)
local arch=$(uname -m)

mkdir bin

case "${os}" in
Darwin)
os=macOS
;;
esac

case "${arch}" in
x86_64)
arch=64bit
;;
esac

curl -LSs "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_${os}-${arch}.tar.gz" | tar -xz -f - -C bin hugo
chmod +x bin/hugo
}

install_virtualenv() {
_install_tool virtualenv
}
Expand Down
40 changes: 40 additions & 0 deletions hadoop-ozone/dev-support/checks/docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/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.

set -u -o pipefail

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "${DIR}/../../.." || exit 1

source "${DIR}/_lib.sh"
install_hugo

REPORT_DIR=${OUTPUT_DIR:-"${DIR}/../../../target/docs"}
mkdir -p "${REPORT_DIR}"
REPORT_FILE="${REPORT_DIR}/summary.txt"

hadoop-hdds/docs/dev-support/bin/generate-site.sh | tee "${REPORT_DIR}/output.log"
rc=$?

grep -o 'ERROR.*' "${REPORT_DIR}/output.log" > "${REPORT_FILE}"

wc -l "${REPORT_FILE}" | awk '{ print $1 }' > "${REPORT_DIR}/failures"

if [[ -s "${REPORT_FILE}" ]]; then
exit 1
fi

exit ${rc}