-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdeploy-cima.sh
executable file
·61 lines (49 loc) · 1.12 KB
/
deploy-cima.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
56
57
58
59
60
61
#!/bin/bash
set -e
TAG="latest"
CIMA_SERVER_IMAGE="cima-server"
REGISTRY=""
DIR=$(dirname "$(readlink -f "$0")")
#
# Display Usage information
#
usage() {
cat <<EOM
Usage: $(basename "$0") [OPTION]...
-r <registry prefix> the prefix string for registry
-g <tag> container image tag
-h show help info
EOM
}
process_args() {
while getopts ":r:g:h" option; do
case "$option" in
r) REGISTRY=$OPTARG ;;
g) TAG=$OPTARG ;;
h)
usage
exit 0
;;
*)
echo "Invalid option '-$OPTARG'"
usage
exit 1
;;
esac
done
CIMA_SERVER_IMAGE="$CIMA_SERVER_IMAGE:$TAG"
if [[ ${REGISTRY: -1} == "/" ]]; then
REGISTRY="${REGISTRY%/}"
fi
if [[ $REGISTRY != "" ]]; then
CIMA_SERVER_IMAGE="$REGISTRY/$CIMA_SERVER_IMAGE"
fi
}
process_args "$@"
# shellcheck disable=SC1091
. "$DIR"/scripts/cache.sh
create_cache_dir
# shellcheck disable=SC1091
. "$DIR"/scripts/docker_compose.sh
create_composes "$CIMA_SERVER_IMAGE"
docker_compose_up