Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
I
install.api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Script
install.api
Commits
faec2864
Commit
faec2864
authored
Apr 08, 2020
by
金凯强
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
work_shop_no
parent
9a769ea8
Pipeline
#22309
failed with stage
in 11 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
install_api.py
app/install/install_api.py
+3
-3
install_service.py
app/install/install_service.py
+4
-4
No files found.
app/install/install_api.py
View file @
faec2864
...
...
@@ -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
)
app/install/install_service.py
View file @
faec2864
...
...
@@ -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
(
'远端服务器信息未查到,请先配置'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment