forked from osrf/ariac-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_all_trials.bash
executable file
·45 lines (36 loc) · 1.02 KB
/
run_all_trials.bash
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
#!/usr/bin/env bash
# Constants.
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NOCOLOR='\033[0m'
# Arguments
TEAM_NAME=$1
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
trial_config_DIR=${DIR}/trial_config/
# Get the available trials from the config directory
get_list_of_trials()
{
yaml_files=$(ls ${trial_config_DIR}/*.yaml)
for f in $(ls ${trial_config_DIR}/*.yaml); do
f=${f##*/}
f=${f//.yaml}
all_names="${all_names} ${f}"
done
echo $all_names
}
echo -e "
${GREEN}Running all trials for team: ${TEAM_NAME}${NOCOLOR}"
LIST_OF_TRIALS="$(get_list_of_trials)"
for TRIAL_NAME in ${LIST_OF_TRIALS}; do
echo "Running trial: ${TRIAL_NAME}..."
CONSOLE_OUTPUT_DIR=logs/${TEAM_NAME}/${TRIAL_NAME}
mkdir -p ${CONSOLE_OUTPUT_DIR}
./run_trial.bash "${TEAM_NAME}" "${TRIAL_NAME}" > ${CONSOLE_OUTPUT_DIR}/output.txt 2>&1
exit_status=$?
if [ $exit_status -eq 0 ]; then
echo -e "${GREEN}OK.${NOCOLOR}"
else
echo -e "${RED}TRIAL FAILED: ${TEAM_NAME}/${TRIAL_NAME}${NOCOLOR}" >&2
fi
done