-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexperiments.sh
executable file
·56 lines (44 loc) · 1.05 KB
/
experiments.sh
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
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
#
# HELPER METHODS
#
experiments_application() {
local application=$1
local application_name
local app_ev
application_name=$(basename "${application}")
echo "--- Enqueueing Experiments for Application: ${application_name}"
# Enqueue experiments
cd "$application" || exit 1
./experiments.sh "${USER_OPTS}"
app_ev=$?
cd "${SCRIPT_DIR}" || exit 1
# Set global exit value
if [ "${app_ev}" -ne 0 ]; then
GLOBAL_EV=${app_ev}
fi
}
#
# MAIN
#
# Set script variables
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Retrieve script parameters
USER_OPTS=$*
# Launch all examples
GLOBAL_EV=0
for app in "${SCRIPT_DIR}"/*/; do
if [ "$app" != "${SCRIPT_DIR}/xml/" ]; then
experiments_application "$app"
fi
done
# Log execution message
if [ "${GLOBAL_EV}" -eq 0 ]; then
echo ""
echo "ALL APPLICATIONS ENQUEUED SUCCESSFULLY!"
echo ""
else
echo ""
echo "ERROR: SOME APPLICATION FAILED. CHECK ERRORS ABOVE"
echo ""
fi