未验证 提交 5d01f64b 编写于 作者: R Rongfeng Fu 提交者: GitHub

fix #74 (#76)

* update example

* fix #74
上级 c30d2373
...@@ -1215,9 +1215,9 @@ class ObdHome(object): ...@@ -1215,9 +1215,9 @@ class ObdHome(object):
self._call_stdio('error', 'Deploy "%s" is %s. You could not reload an %s cluster.' % (name, deploy_info.status.value, deploy_info.status.value)) self._call_stdio('error', 'Deploy "%s" is %s. You could not reload an %s cluster.' % (name, deploy_info.status.value, deploy_info.status.value))
return False return False
# if deploy_info.config_status != DeployConfigStatus.NEED_RELOAD: if deploy_info.config_status == DeployConfigStatus.UNCHNAGE:
# self._call_stdio('error', 'Deploy config %s' % deploy_info.config_status.value) self._call_stdio('print', 'Deploy config is UNCHNAGE')
# return False return True
self._call_stdio('verbose', 'Get deploy config') self._call_stdio('verbose', 'Get deploy config')
deploy_config = deploy.deploy_config deploy_config = deploy.deploy_config
...@@ -1542,9 +1542,9 @@ class ObdHome(object): ...@@ -1542,9 +1542,9 @@ class ObdHome(object):
self._call_stdio('error', 'Not found %s in Deploy "%s" ' % (component, name)) self._call_stdio('error', 'Not found %s in Deploy "%s" ' % (component, name))
return False return False
else: else:
if len(deploy_info.components) == 1: for component in deploy_info.components:
component = deploy_info.components.keys()[0] break
else: if not component:
self._call_stdio('error', 'Specify the components you want to upgrade.') self._call_stdio('error', 'Specify the components you want to upgrade.')
return False return False
......
...@@ -186,7 +186,7 @@ def upgrade_route(plugin_context, current_repository, dest_repository, *args, ** ...@@ -186,7 +186,7 @@ def upgrade_route(plugin_context, current_repository, dest_repository, *args, **
yaml = YamlLoader(stdio) yaml = YamlLoader(stdio)
try: try:
with open(upgrade_dep_path) as f: with open(upgrade_dep_path, encoding='utf-8') as f:
data = yaml.load(f) data = yaml.load(f)
graph = ObVersionGraph(data) graph = ObVersionGraph(data)
route = graph.findShortestUpgradePath(current_repository, dest_repository) route = graph.findShortestUpgradePath(current_repository, dest_repository)
......
...@@ -108,15 +108,16 @@ function build() ...@@ -108,15 +108,16 @@ function build()
CID=`git log |head -n1 | awk -F' ' '{print $2}'` CID=`git log |head -n1 | awk -F' ' '{print $2}'`
BRANCH=`git branch | grep -e "^\*" | awk -F' ' '{print $2}'` BRANCH=`git branch | grep -e "^\*" | awk -F' ' '{print $2}'`
DATE=`date '+%b %d %Y %H:%M:%S'` DATE=`date '+%b %d %Y %H:%M:%S'`
VERSION=$VERSION".`date +%s`"`
BUILD_DIR="$DIR/.build" BUILD_DIR="$DIR/.build"
rm -fr $BUILD_DIR rm -fr $BUILD_DIR
mkdir -p $BUILD_DIR/lib/site-packages mkdir -p $BUILD_DIR/lib/site-packages
mkdir -p $BUILD_DIR/mirror/remote mkdir -p $BUILD_DIR/mirror/remote
wget https://mirrors.aliyun.com/oceanbase/OceanBase.repo -O $BUILD_DIR/mirror/remote/OceanBase.repo wget https://mirrors.aliyun.com/oceanbase/OceanBase.repo -O $BUILD_DIR/mirror/remote/OceanBase.repo
cat _cmd.py | sed "s/<CID>/$CID/" | sed "s/<B_BRANCH>/$BRANCH/" | sed "s/<B_TIME>/$DATE/" | sed "s/<DEBUG>/$OBD_DUBUG/" | sed "s/<VERSION>/$VERSION/" > obd.py cat _cmd.py | sed "s/<CID>/$CID/" | sed "s/<B_BRANCH>/$BRANCH/" | sed "s/<B_TIME>/$DATE/" | sed "s/<DEBUG>/$OBD_DUBUG/" | sed "s/<VERSION>/$VERSION/" > obd.py
pip install -r $req_fn.txt pip install -r $req_fn.txt | exit 1
pip install -r plugins-$req_fn.txt --target=$BUILD_DIR/lib/site-packages pip install -r plugins-$req_fn.txt --target=$BUILD_DIR/lib/site-packages | exit 1
pyinstaller --hidden-import=decimal --hidden-import=configparser -F obd.py pyinstaller --hidden-import=decimal --hidden-import=configparser -F obd.py | exit 1
rm -f obd.py obd.spec rm -f obd.py obd.spec
cp -r plugins $BUILD_DIR/plugins cp -r plugins $BUILD_DIR/plugins
rm -fr /usr/obd /usr/bin/obd rm -fr /usr/obd /usr/bin/obd
......
Name: ob-deploy Name: ob-deploy
Version: 1.2.0 Version: 1.2.1
Release: %(echo $RELEASE)%{?dist} Release: %(echo $RELEASE)%{?dist}
# if you want use the parameter of rpm_create on build time, # if you want use the parameter of rpm_create on build time,
# uncomment below # uncomment below
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册