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 is a launcher script, to be called from Jenkins.
19 # It runs tox at $CSIT_DIR (after activating virtualenv with its requirements).
20 # Exit code of tox is propagated.
22 # "set -eu" handles failures from the following two lines.
23 BASH_ENTRY_DIR="$(dirname $(readlink -e "${BASH_SOURCE[0]}"))"
24 BASH_FUNCTION_DIR="$(readlink -e "${BASH_ENTRY_DIR}/../function")"
25 source "${BASH_FUNCTION_DIR}/common.sh" || {
26 echo "Source failed." >&2
30 cd "${CSIT_DIR}" || die
31 activate_virtualenv "${CSIT_DIR}" "${CSIT_DIR}/tox-requirements.txt" || die
33 # Verbosity is increased so console output shows any unwanted downloads.
37 mkdir -p "${CSIT_DIR}/archives" || die
38 mv *.log "${CSIT_DIR}/archives" || die
40 exit "${TOX_EXIT_STATUS}"