-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker_build.sh
64 lines (57 loc) · 1.58 KB
/
docker_build.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
62
63
#!/bin/bash
# exit as soon as an error happen
set -e
usage() { echo "Usage: $0 -e <environment> -c <config file> " 1>&2; exit 1; }
while getopts ":e:c:" o; do
case "${o}" in
e)
e=${OPTARG}
((e == "moc-alphatestnet" || e == "moc-testnet" || e == "moc-mainnet" || e == "rdoc-testnet" || e == "rdoc-mainnet" || e == "eth-testnet" || e == "eth-mainnet" || e == "tether-testnet" || e == "tether-mainnet" )) || usage
case $e in
moc-alphatestnet)
ENV=$e
;;
moc-testnet)
ENV=$e
;;
moc-mainnet)
ENV=$e
;;
rdoc-testnet)
ENV=$e
;;
rdoc-mainnet)
ENV=$e
;;
eth-testnet)
ENV=$e
;;
eth-mainnet)
ENV=$e
;;
tether-testnet)
ENV=$e
;;
tether-mainnet)
ENV=$e
;;
*)
usage
;;
esac
;;
c)
c=${OPTARG}
CONFIG_FILE=$c
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ -z "${e}" ] || [ -z "${c}" ] ; then
usage
fi
docker image build -t moc_price_feeder_$ENV -f Dockerfile --build-arg CONFIG=$CONFIG_FILE .
echo "Build done!"