Commit 0df8920a authored by 金凯强's avatar 金凯强 🎨

ssh用法修复

parent 5a2f20b1
...@@ -45,5 +45,32 @@ if __name__ == '__main__': ...@@ -45,5 +45,32 @@ if __name__ == '__main__':
# print(res.json()) # print(res.json())
# # 获取app_list # # 获取app_list
res = requests.get('http://localhost:5000/info/app_list/') # res = requests.get('http://localhost:5000/info/app_list/')
# print(json.dumps(res.json(), indent=4))
# # 配置app升级信息
# json_data = [
# {"app_code": "rabbitMQ", "app_name": "rabbitMQ", "app_image": "47.110.145.204:8084/huansi/mq:latest"},
# {"app_code": "Redis", "app_name": "Redis", "app_image": "47.110.145.204:8084/huansi/redis:latest"},
# {"app_code": "Tool", "app_name": "tools工具集", "app_image": "47.110.145.204:8084/huansi/hs_tools:1.1"}]
#
# res = requests.post('http://localhost:5000/info/app_upgrade/', json=json_data)
# print(res.json())
# # 获取app升级日志列表
# res = requests.get('http://localhost:5000/info/upgrade_log/')
# print(json.dumps(res.json(), indent=4))
#
#
# # 获取app单次升级日志明细
# res = requests.get('http://localhost:5000/info/upgrade_log_dtl/1238022723059486720/')
# print(json.dumps(res.json(), indent=4))
# 安装runner
# res = requests.get('http://localhost:5000/install/runner/')
# print(json.dumps(res.json(), indent=4))
# 回滚升级
res = requests.get('http://localhost:5000/upgrade/rollback/1238022723059486720/')
print(json.dumps(res.json(), indent=4)) print(json.dumps(res.json(), indent=4))
\ No newline at end of file
...@@ -66,7 +66,8 @@ class UpgradeService(): ...@@ -66,7 +66,8 @@ class UpgradeService():
# docker-compose # docker-compose
project_info = ConnectionService().get_project_info() project_info = ConnectionService().get_project_info()
host_ip = project_info['host_ip'] host_ip = project_info['host_ip']
ssh = SSHConnect(user_name='root', password='huansi.net', host_port='1111', host_ip=host_ip) ssh_conenct = SSHConnect(user_name='root', password='huansi.net', host_port='1111', host_ip=host_ip)
with ssh_conenct as ssh:
out, err = ssh.exec_command( out, err = ssh.exec_command(
f'''export HUANSI_REGISTRY_URL=47.110.145.204:8084 &&\ f'''export HUANSI_REGISTRY_URL=47.110.145.204:8084 &&\
source /etc/profile.d/huansi.sh &&\ source /etc/profile.d/huansi.sh &&\
......
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