forked from fryckbos/cop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pull.sh
executable file
·60 lines (48 loc) · 1.29 KB
/
pull.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
#!/bin/bash
source conf.sh
source services.sh
function show_help {
echo "Usage: $0 [--version <version>] [<component>|all|data|coscale]"
}
if [ "$1" == "--help" ]; then
show_help
exit 0
fi
if [ "$1" == "--version" ]; then
VERSION="$2"
shift #move command line arguments to the left
shift #move command line arguments to the left
fi
if [ $# -gt 1 ]; then
show_help
exit 1
fi
NAME=${1:-all}
docker login -u "$REGISTRY_USERNAME" -p "$REGISTRY_PASSWORD" -e "$REGISTRY_EMAIL" $REGISTRY
if [ "$NAME" == "base" ]; then
for SERVICE in base python java7 java8 rserve numpy; do
IMG=coscale/$SERVICE:1.1.0
docker pull $REGISTRY/$IMG
docker tag $REGISTRY/$IMG $IMG
done
exit 0
fi
function pull {
SERVICE=$1
IMAGE_VERSION=$2
IMG=coscale/$SERVICE:$IMAGE_VERSION
docker pull $REGISTRY/$IMG
docker tag $REGISTRY/$IMG $IMG
}
# Pull the third party services
for SERVICE in $DATA_SERVICES; do
if [ "$NAME" == "all" ] || [ "$NAME" == "data" ] || [ "$NAME" == "$SERVICE" ]; then
pull $SERVICE $VERSION
fi
done
# Pull the coscale services
for SERVICE in $COSCALE_SERVICES $LB_SERVICE; do
if [ "$NAME" == "all" ] || [ "$NAME" == "coscale" ] || [ "$NAME" == "$SERVICE" ]; then
pull $SERVICE $VERSION
fi
done