-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexecif.sh
More file actions
executable file
·47 lines (37 loc) · 759 Bytes
/
execif.sh
File metadata and controls
executable file
·47 lines (37 loc) · 759 Bytes
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
#!/bin/sh
. "`(dirname "$0")`/utils.sh"
#
export PROJECT="$1"
export VER="$2"
buildImage $PROJECT $VER
if [ $? -eq 0 ]; then
echo "ok"
else
echo "error"
fi
isImagePresent $PROJECT $VER "IMAGE"
echo $IMAGE
#
if [ ! "$PROJECT" ];then
echo "First parameter should be project's name"
exit 1
fi
if [ ! "$VER" ];then
echo "Second parameter should be project's version"
exit 1
fi
#
ID=$PROJECT:$VER
if [ "$PROJECT" ] && [ "$VER" ]; then
IMAGE=$(docker images | grep "$PROJECT" | grep "$VER" | awk '{print $1 ":" $2}')
CONTAINER=$(docker ps | grep "$ID" | awk '{print $1}')
# echo $IMAGE
# echo $CONTAINER
# if [ "$IMAGE" == "$PROJECT:$VER" ]; then
# if [ "$ID" ]; then
# echo not NULL
# else
# echo NULL
# fi
# fi
fi