3 # Copyright (c) 2021 Cisco and/or its affiliates.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
18 # This file should be executed from tox, as the assumend working directory
19 # is different from where this file is located.
20 # This file does not have executable flag nor shebang,
21 # to dissuade non-tox callers.
23 # "set -eu" handles failures from the following two lines.
24 BASH_CHECKS_DIR="$(dirname $(readlink -e "${BASH_SOURCE[0]}"))"
25 BASH_FUNCTION_DIR="$(readlink -e "${BASH_CHECKS_DIR}/../../function")"
26 source "${BASH_FUNCTION_DIR}/common.sh" || {
27 echo "Source failed." >&2
30 source "${BASH_FUNCTION_DIR}/docs.sh" || die "Source failed."
32 activate_virtualenv || die
34 # Documentation generation.
35 # Here we do store only stderr to file while stdout (inlcuding Xtrace) is
36 # printed to console. This way we can track increased errors in future.
37 # We do not need to do trap as the env will be closed after tox finished the
40 export BASH_XTRACEFD="3" || die
41 log_file="$(pwd)/doc_verify.log" || die
43 generate_docs 2> ${log_file} || die
45 if [[ "${DOCS_EXIT_STATUS}" != 0 ]]; then
46 # Failed to generate report.
48 warn "Doc verify checker: FAIL"
53 warn "Doc verify checker: PASS"