From 71603c6a05e7ab91830ca49413e85dd6946f6847 Mon Sep 17 00:00:00 2001 From: caseone <421325991@qq.com> Date: Wed, 24 Mar 2021 16:38:55 +0800 Subject: [PATCH] add init-broker.sh (#757) --- .gitignore | 6 +----- weevent-broker/dist/init-broker.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 weevent-broker/dist/init-broker.sh diff --git a/.gitignore b/.gitignore index 3a2ef565c..8c14c60f8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,11 +7,7 @@ gradle.properties logs/ build/ out/ -weevent-core/dist/ -weevent-client/dist/ -weevent-broker/dist/ -weevent-governance/dist/ -weevent-processor/dist/ + ### npm build node_modules/ diff --git a/weevent-broker/dist/init-broker.sh b/weevent-broker/dist/init-broker.sh new file mode 100644 index 000000000..88a2c3def --- /dev/null +++ b/weevent-broker/dist/init-broker.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +JAVA_HOME=/opt/jdk1.8.0_91 + +if [[ -z ${JAVA_HOME} ]];then + echo "JAVA_HOME is null, please set it first" + exit 1 +fi + +${JAVA_HOME}/bin/java -Xbootclasspath/a:./conf -cp ./apps/* -Dloader.path=./lib,../lib -Dloader.main=com.webank.weevent.broker.db.InitialDb org.springframework.boot.loader.PropertiesLauncher +if [[ $? -ne 0 ]];then + echo "init broker db failed, please check the configuration of mysql" + exit 1 +else + echo "init broker db success" +fi