Migrate report/trending/docs to bash framework
[csit.git] / resources / libraries / bash / entry / bootstrap_docs.sh
1 # Copyright (c) 2021 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 set -exuo pipefail
15
16 # Assumptions:
17 # + There is a directory holding CSIT code to use (this script is there).
18 # Consequences (and specific assumptions) are multiple,
19 # examine tree of functions for current description.
20
21 # "set -eu" handles failures from the following two lines.
22 BASH_ENTRY_DIR="$(dirname $(readlink -e "${BASH_SOURCE[0]}"))"
23 BASH_FUNCTION_DIR="$(readlink -e "${BASH_ENTRY_DIR}/../function")"
24 source "${BASH_FUNCTION_DIR}/common.sh" || {
25     echo "Source failed." >&2
26     exit 1
27 }
28 source "${BASH_FUNCTION_DIR}/docs.sh" || die "Source failed."
29 common_dirs || die
30 activate_virtualenv || die
31 generate_docs || die
32 die_on_docs_error || die