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

远程升级删除旧镜像

parent 249157a0
Pipeline #22422 passed with stage
in 22 seconds
......@@ -168,6 +168,9 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym
with open(docker_compose_file_dir, 'w', encoding='utf8') as f:
f.write(compose_content)
logger.info('删除服务器上的旧镜像文件')
ssh.exec_command('rm /huansi/upgrade/*.tar -f')
for files in os.listdir(upgrade_back_up_dir):
path = os.path.join(upgrade_back_up_dir, files)
# 隐藏文件不复制
......
......@@ -37,9 +37,6 @@ if __name__ == '__main__':
with open('/data/nginx/conf/rpc.conf', 'w')as f:
f.write(rpc_conf_content)
print('删除旧镜像')
os.system('rm *.tar -f')
with os.popen('ls | grep .tar') as f:
cmd_txt = f.read()
......
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