forked from CityOfZion/neo-privatenet-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_build.sh
executable file
·63 lines (56 loc) · 1.61 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
set -e
# To use a newer neo-cli version, just update this variable:
NEO_CLI_VERSION="2.7.4"
function usage {
echo "Usage: $0 [--no-cache] [--neo-cli <zip-fn>]"
}
while [[ "$#" > 0 ]]; do case $1 in
-h)
usage
exit 0
;;
--no-cache)
DISABLE_CACHE=1
shift
;;
--neo-cli)
# Custom neo-cli zip filename
NEO_CLI_CUSTOM_ZIPFN=$2
if [[ -z $NEO_CLI_CUSTOM_ZIPFN ]]; then
echo "Error: Please specify a neo-cli zip file"
usage
exit 1
fi
echo "Custom neo-cli zip: $NEO_CLI_CUSTOM_ZIPFN"
shift; shift
;;
*)
usage
exit 1
;;
esac;
done
# Definition of standard neo-cli filenames and URL based on the version
NEO_CLI_ZIPFN="neo-release-${NEO_CLI_VERSION}.zip"
NEO_CLI_URL="https://github.com/neo-project/neo-cli/releases/download/v${NEO_CLI_VERSION}/neo-cli-linux-x64.zip"
if [ -z "$NEO_CLI_CUSTOM_ZIPFN" ]; then
echo "Using downloaded neo-cli v${NEO_CLI_VERSION}"
if [ -e "${NEO_CLI_ZIPFN}" ] && [ -z "$DISABLE_CACHE" ]
then
echo "- release already downloaded: ${NEO_CLI_ZIPFN}"
else
echo "- downloading ${NEO_CLI_URL}..."
wget --no-check-certificate -O $NEO_CLI_ZIPFN $NEO_CLI_URL || (rm -f $NEO_CLI_ZIPFN && exit 1)
fi
cp $NEO_CLI_ZIPFN ./neo-cli.zip
else
echo "Using custom neo-cli.zip: $NEO_CLI_CUSTOM_ZIPFN"
cp $NEO_CLI_CUSTOM_ZIPFN ./neo-cli.zip
fi
if [ -z "$DISABLE_CACHE" ]; then
docker build -t neo-privnet .
else
echo "docker build no cache"
docker build --no-cache -t neo-privnet .
fi