Newer
Older
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
print_help () {
echo "Builds images of specified services. If no option specified, builds images of all services."
echo "This script should be run when a new version of the project with updated requirements or Dockerfile is pulled"
echo ""
echo "options:"
echo "-h, --help show help"
echo "--detection build detection service image"
echo "--tracking build tracking service image"
echo "--pose3d build 3d pose estimation service image"
echo "--distance build distance estimation service image"
echo "--actions build actions classification service image"
}
devbeh_all=true
devbeh_detection=false
devbeh_tracking=false
devbeh_pose3d=false
devbeh_distance=false
devbeh_actions=false
while test $# -gt 0; do
case "$1" in
-h|--help)
print_help
exit 0
;;
--detection)
devbeh_all=false
devbeh_detection=true
shift
;;
--tracking)
devbeh_all=false
devbeh_tracking=true
shift
;;
--pose3d)
devbeh_all=false
devbeh_pose3d=true
shift
;;
--distance)
devbeh_all=false
devbeh_distance=true
shift
;;
--actions)
devbeh_all=false
devbeh_actions=true
shift
;;
*)
shift
;;
esac
done
if [ "$devbeh_all" = true ] || [ "$devbeh_detection" = true ]; then
devbeh_services="$devbeh_services detection"
fi
if [ "$devbeh_all" = true ] || [ "$devbeh_tracking" = true ]; then
devbeh_services="$devbeh_services tracking"
fi
if [ "$devbeh_all" = true ] || [ "$devbeh_pose3d" = true ]; then
devbeh_services="$devbeh_services pose3d"
fi
if [ "$devbeh_all" = true ] || [ "$devbeh_distance" = true ]; then
devbeh_services="$devbeh_services distance"
fi
if [ "$devbeh_all" = true ] || [ "$devbeh_actions" = true ]; then
devbeh_services="$devbeh_services actions"
fi
current_dir=$(pwd)
cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
# shellcheck disable=SC2086
docker-compose build --parallel $devbeh_services
cd "$current_dir" || exit 1