-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathinstall.sh
executable file
·134 lines (113 loc) · 3.25 KB
/
install.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/usr/bin/env bash
mvn install
if [ $? -ne 0 ]; then
echo "ERROR: Maven package failed. Stop installing Pixels."
exit 1
fi
if [ -z "$PIXELS_HOME" ]; then
echo "ERROR: PIXELS_HOME is not set. Stop installing Pixels."
exit 1
else
echo "PIXELS_HOME is '$PIXELS_HOME'"
fi
# remove the last '/', this is optional, but makes the output look better
if [[ "$PIXELS_HOME" == *"/" ]]
then
PIXELS_HOME=${PIXELS_HOME::-1}
fi
mkdir -p $PIXELS_HOME/bin
mkdir -p $PIXELS_HOME/sbin
mkdir -p $PIXELS_HOME/etc
mkdir -p $PIXELS_HOME/lib
mkdir -p $PIXELS_HOME/listener
mkdir -p $PIXELS_HOME/logs
mkdir -p $PIXELS_HOME/var
echo "Installing scripts..."
CP_SBIN=0
if [ -z "$(ls -A $PIXELS_HOME/sbin)" ]; then
CP_SBIN=1
else
read -p "'$PIXELS_HOME/sbin' not empty, override?[y/n]" -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
CP_SBIN=1
fi
fi
if [ $CP_SBIN -eq 1 ]; then
cp -v ./scripts/sbin/* $PIXELS_HOME/sbin
fi
CP_BIN=0
if [ -z "$(ls -A $PIXELS_HOME/bin)" ]; then
CP_BIN=1
else
read -p "'$PIXELS_HOME/bin' not empty, override?[y/n]" -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
CP_BIN=1
fi
fi
if [ $CP_BIN -eq 1 ]; then
cp -v ./scripts/bin/* $PIXELS_HOME/bin
fi
echo "Installing pixels-daemons..."
cp -v ./pixels-daemon/target/pixels-daemon-*-full.jar $PIXELS_HOME/bin
echo "Installing pixels-cli..."
cp -v ./pixels-cli/target/pixels-cli-*-full.jar $PIXELS_HOME/sbin
if [ -z "$(ls -A $PIXELS_HOME/lib)" ]; then
echo "$(
tput setaf 1
tput setab 7
)Make sure to put the jdbc connector of MySQL into '$PIXELS_HOME/lib'!$(tput sgr 0)"
fi
echo "Installing config files..."
# copy the jvm and worker nodes config files
CP_ETC=0
if [ -z "$(ls -A $PIXELS_HOME/etc)" ]; then
CP_ETC=1
else
read -p "'$PIXELS_HOME/etc' not empty, override?[y/n]" -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
CP_ETC=1
fi
fi
if [ $CP_ETC -eq 1 ]; then
cp -v ./scripts/etc/* $PIXELS_HOME/etc
fi
# find and copy pixels.properties
if [ -z "$(find $PIXELS_HOME/etc -name "pixels.properties")" ]; then
cp -v ./pixels-common/src/main/resources/pixels.properties $PIXELS_HOME/etc
echo "$(
tput setaf 1
tput setab 7
)Make sure to modify '$PIXELS_HOME/etc/pixels.properties'!$(tput sgr 0)"
else
read -p "'$PIXELS_HOME/etc/pixels.properties' exists, override?[y/n]" -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
cp -v ./pixels-common/src/main/resources/pixels.properties $PIXELS_HOME/etc
fi
fi
# find and copy pixels-cpp.properties
if [ -z "$(find $PIXELS_HOME/etc -name "pixels-cpp.properties")" ]; then
cp -v ./cpp/pixels-cpp.properties $PIXELS_HOME/etc
echo "$(
tput setaf 1
tput setab 7
)Make sure to modify '$PIXELS_HOME/etc/pixels-cpp.properties'!$(tput sgr 0)"
else
read -p "'$PIXELS_HOME/etc/pixels-cpp.properties' exists, override?[y/n]" -n 1 -r
echo # move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
cp -v ./cpp/pixels-cpp.properties $PIXELS_HOME/etc
fi
fi
# prompt the post-install steps
echo "$(
tput setaf 1
tput setab 7
)You may need to install and configure MySQL and etcd. Please refer to README.$(tput sgr 0)"
echo "$(
tput setaf 1
tput setab 7
)See the README of pixels-presto/trino/hive to install a query engine.$(tput sgr 0)"