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

测试

parent 8163e547
...@@ -47,13 +47,14 @@ class InstallService(HSBaseUCService): ...@@ -47,13 +47,14 @@ class InstallService(HSBaseUCService):
:param HSCUSCODE: :param HSCUSCODE:
:return: :return:
''' '''
# 测试下载时间
time.sleep(20)
return {"message": "runner注册成功", "step": "1", "status": "running", "later_message": "正在修改runner配置..."}
conncetion_service = ConnectionService() conncetion_service = ConnectionService()
project_info = conncetion_service.get_project_info() project_info = conncetion_service.get_project_info()
if not project_info: if not project_info:
raise HSException('项目信息未查到,请先配置') raise HSException('项目信息未查到,请先配置')
project_code = project_info['project_no'] project_code = project_info['project_no']
# 测试下载时间
time.sleep(20)
self.delete_setting_file() self.delete_setting_file()
s1 = os.system("docker run --rm -t -i -v /etc/gitlab-runner:/etc/gitlab-runner gitlab/gitlab-runner register \ s1 = os.system("docker run --rm -t -i -v /etc/gitlab-runner:/etc/gitlab-runner gitlab/gitlab-runner register \
-n -u http://47.110.145.204:8085/ -r WwpzH4qk19KjvAjEwoTz --executor docker --docker-image docker \ -n -u http://47.110.145.204:8085/ -r WwpzH4qk19KjvAjEwoTz --executor docker --docker-image docker \
...@@ -70,6 +71,8 @@ class InstallService(HSBaseUCService): ...@@ -70,6 +71,8 @@ class InstallService(HSBaseUCService):
:param HSCUSCODE: :param HSCUSCODE:
:return: :return:
''' '''
time.sleep(1)
return {"message": "runner配置修改成功", "step": "2", "status": "running", "later_message": "正在重启runner..."}
self._edit_runner_setting() self._edit_runner_setting()
self._remove_old_runner_container() self._remove_old_runner_container()
...@@ -81,6 +84,8 @@ class InstallService(HSBaseUCService): ...@@ -81,6 +84,8 @@ class InstallService(HSBaseUCService):
:param HSCUSCODE: :param HSCUSCODE:
:return: :return:
''' '''
time.sleep(1)
return {"message": "runner重启成功", "step": "3", "status": "success"}
self.start_runner() self.start_runner()
return {"message": "runner重启成功", "step": "3", "status": "success"} return {"message": "runner重启成功", "step": "3", "status": "success"}
......
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