-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathbuild_image.sh
executable file
·51 lines (36 loc) · 994 Bytes
/
build_image.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
#!/bin/bash
source qm.variables
source lib/common.sh
function getTag() {
local __tag=$1
local __defaultVal=$2
local __resultvar=$3
if [ $__tag = "development" ]; then
__newValue="Dev"
elif [ $__tag = "master" ]; then
__newValue=$__defaultVal
elif [[ $__tag == V* ]] || [[ $__tag == v* ]]; then
__newValue=$(echo $__tag | cut -c 2-)
else
__newValue=$__tag
fi
eval $__resultvar="'$__newValue'"
}
if [ ! -z "$1" ]; then
dockerImage=$1
fi
if [ ! -z "$2" ]; then
tagname=$2
else
branch=$(git branch | grep \* | cut -d ' ' -f2-)
getTag $quorum_version 2.0.2 quorum_version
getTag $branch $quorum_maker_version quorum_maker_version
tagname=$quorum_version"_"$quorum_maker_version
fi
dockername=$dockerImage":"$tagname
echo $CYAN"Building image, "$dockername"..."$COLOR_END
lib/install_quorum.sh
lib/install_tessera.sh
lib/build_nodemanager.sh
lib/build_ui.sh
docker build -t $dockername .