Commit 2f14d73838d62ce3cb6ebe2042724c9330ab0555
1 parent
98f52571
Development DB installation scripts added
Showing
2 changed files
with
74 additions
and
0 deletions
1 | +#!/bin/bash | |
2 | +# | |
3 | +# Copyright © 2016-2017 The Thingsboard Authors | |
4 | +# | |
5 | +# Licensed under the Apache License, Version 2.0 (the "License"); | |
6 | +# you may not use this file except in compliance with the License. | |
7 | +# You may obtain a copy of the License at | |
8 | +# | |
9 | +# http://www.apache.org/licenses/LICENSE-2.0 | |
10 | +# | |
11 | +# Unless required by applicable law or agreed to in writing, software | |
12 | +# distributed under the License is distributed on an "AS IS" BASIS, | |
13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
14 | +# See the License for the specific language governing permissions and | |
15 | +# limitations under the License. | |
16 | +# | |
17 | + | |
18 | + | |
19 | +BASE=${project.basedir}/target | |
20 | +CONF_FOLDER=${BASE}/conf | |
21 | +jarfile="${BASE}/thingsboard-${project.version}-boot.jar" | |
22 | +installDir=${BASE}/data | |
23 | +loadDemo=true | |
24 | + | |
25 | + | |
26 | +export JAVA_OPTS="$JAVA_OPTS -Dplatform=@pkg.platform@" | |
27 | +export LOADER_PATH=${BASE}/conf,${BASE}/extensions | |
28 | +export SQL_DATA_FOLDER=/tmp | |
29 | + | |
30 | + | |
31 | +run_user=thingsboard | |
32 | + | |
33 | +su -s /bin/sh -c "java -cp ${jarfile} $JAVA_OPTS -Dloader.main=org.thingsboard.server.ThingsboardInstallApplication \ | |
34 | + -Dinstall.data_dir=${installDir} \ | |
35 | + -Dinstall.load_demo=${loadDemo} \ | |
36 | + -Dspring.jpa.hibernate.ddl-auto=none \ | |
37 | + -Dinstall.upgrade=false \ | |
38 | + -Dlogging.config=logback.xml \ | |
39 | + org.springframework.boot.loader.PropertiesLauncher" "$run_user" | |
40 | + | |
41 | +if [ $? -ne 0 ]; then | |
42 | + echo "ThingsBoard DB installation failed!" | |
43 | +else | |
44 | + echo "ThingsBoard DB installed successfully!" | |
45 | +fi | |
46 | + | |
47 | +exit $? | ... | ... |
1 | +@ECHO OFF | |
2 | + | |
3 | +setlocal ENABLEEXTENSIONS | |
4 | + | |
5 | +SET BASE=${project.basedir}\target | |
6 | +SET LOADER_PATH=%BASE%\conf,%BASE%\extensions | |
7 | +SET SQL_DATA_FOLDER=%~dp0\tmp | |
8 | +SET jarfile=%BASE%\thingsboard-${project.version}-boot.jar | |
9 | +SET installDir=%BASE%\data | |
10 | +SET loadDemo=true | |
11 | + | |
12 | +SET SQL_DATA_FOLDER=/tmp | |
13 | + | |
14 | +java -cp %jarfile% -Dloader.main=org.thingsboard.server.ThingsboardInstallApplication^ | |
15 | + -Dinstall.data_dir=%installDir%^ | |
16 | + -Dinstall.load_demo=%loadDemo%^ | |
17 | + -Dspring.jpa.hibernate.ddl-auto=none^ | |
18 | + -Dinstall.upgrade=false^ | |
19 | + -Dlogging.config=%BASE%\windows\install\logback.xml^ | |
20 | + org.springframework.boot.loader.PropertiesLauncher | |
21 | + | |
22 | +if NOT errorlevel == 0 ( | |
23 | + @echo ThingsBoard DB installation failed! | |
24 | + POPD | |
25 | + exit /b %errorlevel% | |
26 | + ) | |
27 | +@echo ThingsBoard DB installed successfully! | ... | ... |