-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·98 lines (85 loc) · 1.79 KB
/
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#! /bin/bash
case $1 in
"--no-cache")
ARGS="--no-cache"
;;
"")
;;
*)
echo Unknown argument: $1
echo Usage:
echo -e "\t./build.sh [--no-cache]"
exit 1
;;
esac
echo "-----------------------------"
echo "* Building Sia Container"
echo "-----------------------------"
echo ""
cd containers
cd sia
docker build $ARGS -t droghio/sia .
echo ""
echo "-----------------------------"
echo "* Building Sia Test Container"
echo "-----------------------------"
echo""
cd ../sia-test
docker build $ARGS -t droghio/sia-test .
echo ""
echo "-----------------------------"
echo "* Building Sia Genesis Container"
echo "-----------------------------"
echo""
cd ../sia-gen
docker build $ARGS -t droghio/sia-gen .
echo ""
echo "-----------------------------"
echo "* Building EchoIP Container"
echo "-----------------------------"
echo ""
cd ../echoip
docker build $ARGS -t echoip .
cd ../
echo ""
echo "-----------------------------"
echo "* Creating Data Directiories"
echo "-----------------------------"
echo ""
stat nodes_data &> /dev/null
if [[ $? == 1 ]]
then
mkdir nodes_data
else
echo "Using existing nodes_data directory"
fi
stat nodes_data/logs &> /dev/null
if [[ $? == 1 ]]
then
mkdir nodes_data/logs
else
echo "Using existing log directory"
fi
stat nodes_data/error &> /dev/null
if [[ $? == 1 ]]
then
mkdir nodes_data/error
else
echo "Using existing error log directory"
fi
stat /var/run/scope/plugins &> /dev/null
if [[ $? == 1 ]]
then
mkdir /var/run/scope
mkdir /var/run/scope/plugins
else
echo "Using existing plugins directory"
fi
cd ..
echo ""
echo "-----------------------------"
echo "* Build Complete!"
echo "-----------------------------"
echo ""
echo "To start nodes run:"
echo -e "\t./run.sh tests/test_to_run.yml"