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

work_shop_no

parent 9a769ea8
Pipeline #22309 failed with stage
in 11 seconds
......@@ -24,10 +24,10 @@ class InstallAPI(ApiController):
'''
return InstallService().install_runner(project_no)
@api('remote_server/docker/<string:project_no>')
def get_install_remote_server_docker(self, project_no):
@api('remote_server/docker/<string:project_no>/<string:work_shop_no>')
def get_install_remote_server_docker(self, project_no, work_shop_no):
'''
远端服务器安装docker
:return:
'''
return InstallService().install_remote_service_docker(project_no)
return InstallService().install_remote_service_docker(project_no, work_shop_no)
......@@ -103,17 +103,17 @@ class InstallService(HSBaseUCService):
os.system('rm -f /etc/gitlab-runner/config.toml')
logger.info('删除配置文件成功')
def install_remote_service_docker(self, project_no):
def install_remote_service_docker(self, project_no, work_shop_no):
'''
安装远端服务器的docker
:return:
'''
t = Thread(target=self._install_remote_service_docker, args=(project_no,))
t = Thread(target=self._install_remote_service_docker, args=(project_no, work_shop_no))
t.start()
return {"message": "开始安装docker"}
def _install_remote_service_docker(self, project_no):
def _install_remote_service_docker(self, project_no, work_shop_no):
logger.info('开启安装docker')
logger.info('期间需要一段时间,请耐心等待')
from flask_app import global_app
......@@ -122,7 +122,7 @@ class InstallService(HSBaseUCService):
g.user = {}
g.language = 'cn'
remote_server_info = ConnectionService().get_remote_server_info(project_no)
remote_server_info = ConnectionService().get_remote_server_info(project_no, work_shop_no)
if not remote_server_info:
logger.info('docker安装失败')
raise HSException('远端服务器信息未查到,请先配置')
......
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