Commit 70269312 authored by 金凯强's avatar 金凯强 🎨

升级的时候 顺便把环境变量文件上传过去

parent 49aaf8d2
......@@ -9,7 +9,7 @@ from app.conncetion.conncetion_service import ConnectionService
from app.info.info_service import docker_client
from app.utils.db_tools import db_driver
from app.utils.ssh_tools import SSHConnect
from static_file import back_up_dir, builds_dir, temp_file_dir, system_file_dir
from static_file import back_up_dir, builds_dir, temp_file_dir, system_file_dir, profile_dir
class UpgradeService():
......@@ -134,6 +134,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym
ssh.upload(path, f'/huansi/upgrade/{files}')
ssh.upload(os.path.join(system_file_dir, 'load.sh'), '/huansi/upgrade/load.sh')
ssh.upload(os.path.join(profile_dir, 'huansi.sh'), '/huansi/upgrade/huansi.sh')
ssh.upload(os.path.join(system_file_dir, 'load_handle.py'), '/huansi/upgrade/load_handle.py')
out, err = ssh.exec_command("sh /huansi/upgrade/load.sh")
......
......@@ -35,11 +35,11 @@ if __name__ == '__main__':
if app_str == '*':
res = os.system('''export HUANSI_REGISTRY_URL=47.110.145.204:8084 &&\
source /etc/profile.d/huansi.sh &&\
docker-compose up -p deploy -d --force-recreate''')
source /huansi/upgrade/huansi.sh &&\
docker-compose -p deploy up -d --force-recreate''')
else:
res = os.system('''export HUANSI_REGISTRY_URL=47.110.145.204:8084 &&\
source /etc/profile.d/huansi.sh &&\
source /huansi/upgrade/huansi.sh &&\
docker-compose -p deploy up -d --force-recreate --no-deps {}'''.format(app_str))
if res == 1: raise RuntimeError('程序升级失败')
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