forked from dgiot/dgiot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-dashboard.sh
executable file
·128 lines (100 loc) · 3.52 KB
/
get-dashboard.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
#!/usr/bin/env bash
set -euo pipefail
# ensure dir
cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
PKG_VSN="${PKG_VSN:-$(./pkg-vsn.sh)}"
case "${PKG_VSN}" in
4.3*)
EMQX_CE_DASHBOARD_VERSION='v4.3.12'
EMQX_EE_DASHBOARD_VERSION='v4.3.27'
;;
4.4*)
# keep the above 4.3 untouched, otherwise conflicts!
EMQX_CE_DASHBOARD_VERSION='v4.4.7'
EMQX_EE_DASHBOARD_VERSION='v4.4.18'
;;
*)
echo "Unsupported version $PKG_VSN" >&2
exit 1
;;
esac
case $(uname) in
*Darwin*) SED="sed -E";;
*) SED="sed -r";;
esac
version() {
grep -oE 'github_ref: (.*)' "$DASHBOARD_PATH/www/version" | $SED 's|github_ref: refs/tags/(.*)|\1|g'
}
if [ -d "$DASHBOARD_PATH/www" ] && [ "$(version)" = "$VERSION" ]; then
exit 0
fi
EMQX_LIBCE_PATH='lib-ce/'
DGIOT_DASHBOARD_PATH='apps/dgiot_api/priv'
FILESEVER="https://dgiot-release-1306147891.cos.ap-nanjing.myqcloud.com/v4.4.0"
get_lib_ce(){
cd ${$EMQX_LIBCE_PATH}
if [ ! -d "emqx_dashboard/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-dashboard.git" emqx_dashboard
fi
if [ ! -d "emqx_modules/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-modules.git" emqx_modules
fi
if [ ! -d "emqx_telemetry/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-telemetry.git" emqx_telemetry
fi
cd ..
}
get_dgiot_dashboard(){
if [ -d "$DGIOT_DASHBOARD_PATH/www" ]; then
echo "dgiot_dashboard exist"
else
wget ${FILESEVER}/www.tar.gz
tar xvf www.tar.gz
mv www "$DGIOT_DASHBOARD_PATH/"
rm www.tar.gz -rf
chmod 777 ./scripts/*
fi
}
get_apps() {
cd ${EMQX_APP}
if [ ! -d "emqx_plugin_libs/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx_plugin_libs.git" emqx_plugin_libs
fi
if [ ! -d "emqx_rule_engine/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-rule-engine.git" emqx_rule_engine
fi
if [ ! -d "emqx_bridge_mqtt/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-bridge-mqtt.git" emqx_bridge_mqtt
fi
if [ ! -d "emqx_exhook/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-exhook.git" emqx_exhook
fi
if [ ! -d "emqx_auth_mnesia/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-auth-mnesia.git" emqx_auth_mnesia
fi
if [ ! -d "emqx_management/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-management.git" emqx_management
fi
if [ ! -d "emqx_prometheus/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-prometheus.git" emqx_prometheus
fi
if [ ! -d "emqx_psk_file/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-psk-file.git" emqx_psk_file
fi
if [ ! -d "emqx_recon/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-recon.git" emqx_recon
fi
if [ ! -d "emqx_retainer/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-retainer.git" emqx_retainer
fi
if [ ! -d "emqx_sasl/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-sasl.git" emqx_sasl
fi
if [ ! -d "emqx_sn/" ]; then
git clone -b "v4.4.11" --depth=1 "https://gitee.com/fastdgiot/emqx-sn.git" emqx_sn
fi
cd ..
}
get_apps
get_dgiot_dashboard
get_lib_ce