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
940bbbd0
Commit
940bbbd0
authored
Apr 09, 2020
by
金凯强
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
远程升级提示修改
远程升级上传文件的时候只删除tar文件
parent
0e3b953f
Pipeline
#22411
passed with stage
in 25 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
upgrade_service.py
app/upgrade/upgrade_service.py
+7
-2
No files found.
app/upgrade/upgrade_service.py
View file @
940bbbd0
...
...
@@ -166,8 +166,10 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym
logger
.
info
(
f
"现在没有卡住,是正在上传文件{files},请耐心等待"
)
ssh
.
upload
(
path
,
f
'/huansi/upgrade/{files}'
)
logger
.
info
(
f
"地址:{path}上传完毕"
)
os
.
remove
(
path
)
logger
.
info
(
f
"本地缓存{path}已经清除"
)
if
'.tar'
in
path
:
os
.
remove
(
path
)
logger
.
info
(
f
"本地缓存{path}已经清除"
)
ssh
.
upload
(
os
.
path
.
join
(
system_file_dir
,
'load.sh'
),
'/huansi/upgrade/load.sh'
)
# 传入服务器配置的DB
...
...
@@ -175,6 +177,9 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym
# ssh.upload(os.path.join(profile_dir, 'huansi_server.sh'), '/huansi/upgrade/huansi.sh')
ssh
.
upload
(
os
.
path
.
join
(
system_file_dir
,
'load_handle.py'
),
'/huansi/upgrade/load_handle.py'
)
logger
.
info
(
'正在远程升级程序中,请不要着急,慢慢来。。。'
)
logger
.
info
(
'温馨提示:如果是第一次升级,会有点慢,但是不要担心是卡住了,更不要断网,这样会功亏一篑'
)
logger
.
info
(
'如果您还是担心卡住了,连上客户机的服务器上,输入docker images查看是否多了几个镜像(仅对第一次升级有用)'
)
out
,
err
=
ssh
.
exec_command
(
"sh /huansi/upgrade/load.sh"
)
logger
.
info
(
f
'远程升级信息:{out},远程错误信息:{out}'
)
...
...
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