Commit 293740e0 authored by 金凯强's avatar 金凯强 🎨

加日志

parent 7e40b36f
Pipeline #21284 passed with stage
in 41 seconds
...@@ -106,6 +106,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym ...@@ -106,6 +106,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym
docker_compose_file_dir = os.path.join(back_up_dir, upgrade_no, 'docker-compose.yml') docker_compose_file_dir = os.path.join(back_up_dir, upgrade_no, 'docker-compose.yml')
logger.info(f'备份的compose文件地址:{docker_compose_file_dir}') logger.info(f'备份的compose文件地址:{docker_compose_file_dir}')
if not os.path.exists(docker_compose_file_dir): if not os.path.exists(docker_compose_file_dir):
logger.info('远程升级失败')
raise HSException(f'未找到{docker_compose_file_dir}') raise HSException(f'未找到{docker_compose_file_dir}')
return docker_compose_file_dir return docker_compose_file_dir
...@@ -388,6 +389,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym ...@@ -388,6 +389,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym
_cmd = 'docker save {} -o {}/{}'.format(deploy_image, upgrade_no_back_up_dir, file_name) _cmd = 'docker save {} -o {}/{}'.format(deploy_image, upgrade_no_back_up_dir, file_name)
result = os.system(_cmd) result = os.system(_cmd)
if result != 0: if result != 0:
logger.info('远程升级失败')
raise RuntimeError("{}执行出错".format(_cmd)) raise RuntimeError("{}执行出错".format(_cmd))
logger.info(f'镜像生成完毕,目录为{upgrade_no_back_up_dir}') logger.info(f'镜像生成完毕,目录为{upgrade_no_back_up_dir}')
...@@ -420,6 +422,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym ...@@ -420,6 +422,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym
if app_list_str: if app_list_str:
app_list_str = app_list_str[0] app_list_str = app_list_str[0]
else: else:
logger.info('远程升级失败')
raise HSException('未能找到app_list') raise HSException('未能找到app_list')
return app_list_str return app_list_str
...@@ -438,6 +441,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym ...@@ -438,6 +441,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym
if app_list_str: if app_list_str:
app_list_str = app_list_str[0] app_list_str = app_list_str[0]
else: else:
logger.info('远程升级失败')
raise HSException('未能找到app_list') raise HSException('未能找到app_list')
# 如果是*,返回所有镜像名 # 如果是*,返回所有镜像名
...@@ -484,6 +488,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym ...@@ -484,6 +488,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym
app_info = session.retrive_sql(query_app_sql) app_info = session.retrive_sql(query_app_sql)
if not app_info: if not app_info:
logger.info('远程升级失败')
raise HSException('未找到升级信息') raise HSException('未找到升级信息')
upgrade_no = app_info['upgrade_no'] upgrade_no = app_info['upgrade_no']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment