diff options
author | luxin <luxin7@huawei.com> | 2017-07-03 10:19:19 +0800 |
---|---|---|
committer | luxin <luxin7@huawei.com> | 2017-07-03 10:19:19 +0800 |
commit | 056dcab91efc64b5f9fc39825f9242e7fa0b9d05 (patch) | |
tree | d1af18cb6bfa6d3d61f0f77ff958d5a3ce7d6d06 /ResmanagementService/deployment/src/main/release/bin | |
parent | d0ad118ba98d809ddc8eece49cf1fe1dfc83fc74 (diff) |
Upload nfvo resmanagement code
Change-Id: Ibe023d4b09e1105b84eb43153b4d4037cae691db
Signed-off-by: luxin <luxin7@huawei.com>
Diffstat (limited to 'ResmanagementService/deployment/src/main/release/bin')
3 files changed, 149 insertions, 0 deletions
diff --git a/ResmanagementService/deployment/src/main/release/bin/init_db.sh b/ResmanagementService/deployment/src/main/release/bin/init_db.sh new file mode 100644 index 0000000..0c29d73 --- /dev/null +++ b/ResmanagementService/deployment/src/main/release/bin/init_db.sh @@ -0,0 +1,61 @@ +#******************************************************************************* +# Copyright 2016 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#******************************************************************************* +#!/bin/bash + +cd .. + +if [ -z "$1" ] +then + echo "usage: init_db.sh <db user> <db password> <db server ip> <db port> " + exit 1 +fi + +if [ -z "$2" ] +then + echo "usage: init_db.sh <db user> <db password> <db server ip> <db port> " + exit 1 +fi + +if [ -z "$3" ] +then + echo "usage: init_db.sh <db user> <db password> <db server ip> <db port> " + exit 1 +fi + +if [ -z "$4" ] +then + echo "usage: init_db.sh <db user> <db password> <db server ip> <db port> " + exit 1 +fi + +echo +echo "DB-INIT [resmanagementdb] : START" + +mysql -u$1 -p$2 -h$3 -P$4 <$(cd `dirname $0`; pwd)/db/mysql/db-schema.sql + +if [ $? != 0 ] ; then + echo "DB-INIT [resmanagementdb] : FAILED !" + exit 1 +fi + +echo "DB-INIT [resmanagementdb] : PASSED" +echo +echo "*************************************************************" +echo "CAUTION: Existing resmanagementdb will be cleaned before" +echo "initializing the schema, so please take a back-up of it" +echo "before executing it next time." +echo "*************************************************************" +exit 0
\ No newline at end of file diff --git a/ResmanagementService/deployment/src/main/release/bin/start.sh b/ResmanagementService/deployment/src/main/release/bin/start.sh new file mode 100644 index 0000000..ddd7d58 --- /dev/null +++ b/ResmanagementService/deployment/src/main/release/bin/start.sh @@ -0,0 +1,47 @@ +# +# Copyright 2016 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#!/bin/bash +cd .. +export CATALINA_BASE=$(cd `dirname $0`; pwd) + +if [ -z "$JAVA_HOME" ] +then + echo "There is no JAVA_HOME" + exit 1 +fi + +if [ -z "$CATALINA_HOME" ] +then + echo "There is no CATALINA_HOME" + exit 1 +fi + +if [ -z "$CATALINA_BASE" ] +then + echo "There is no CATALINA_BASE" + exit 1 +fi + +export CATALINA_PID="$CATALINA_BASE/bin/catalina.pid" + +LOG_DIR=$CATALINA_BASE/logs +if [ ! -d "$LOG_DIR" ]; then + mkdir $LOG_DIR +fi + +$CATALINA_HOME/bin/catalina.sh start + + diff --git a/ResmanagementService/deployment/src/main/release/bin/stop.sh b/ResmanagementService/deployment/src/main/release/bin/stop.sh new file mode 100644 index 0000000..a0acfe6 --- /dev/null +++ b/ResmanagementService/deployment/src/main/release/bin/stop.sh @@ -0,0 +1,41 @@ +# +# Copyright 2016 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +#!/bin/bash +cd .. +export CATALINA_BASE=$(cd `dirname $0`; pwd) + +if [ -z "$JAVA_HOME" ] +then + echo "There is no JAVA_HOME" + exit 1 +fi + +if [ -z "$CATALINA_HOME" ] +then + echo "There is no CATALINA_HOME" + exit 1 +fi + +export CATALINA_PID="$CATALINA_BASE/bin/catalina.pid" + +if [ -z "$CATALINA_BASE" ] +then + echo "There is no CATALINA_BASE" + exit 1 +fi + +$CATALINA_HOME/bin/catalina.sh stop -force |