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
249157a0
Commit
249157a0
authored
Apr 09, 2020
by
金凯强
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
远程升级删除旧镜像
修改app_list
parent
940bbbd0
Pipeline
#22416
passed with stage
in 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
upgrade_service.py
app/upgrade/upgrade_service.py
+12
-0
load_handle.py
static_file/system_file/load_handle.py
+3
-0
No files found.
app/upgrade/upgrade_service.py
View file @
249157a0
...
...
@@ -157,6 +157,17 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym
# 打包镜像
self
.
_package_images
(
upgrade_no
,
code_list_str
)
# 修改app_list
docker_compose_file_dir
=
self
.
find_compose_by_upgrade_no
(
upgrade_no
)
with
open
(
docker_compose_file_dir
,
'r'
,
encoding
=
'utf8'
)
as
f
:
compose_content
=
f
.
read
()
compose_content
=
re
.
sub
(
'# app_list: "(.*)"'
,
f
'# app_list: "{code_list_str}"'
,
compose_content
)
with
open
(
docker_compose_file_dir
,
'w'
,
encoding
=
'utf8'
)
as
f
:
f
.
write
(
compose_content
)
for
files
in
os
.
listdir
(
upgrade_back_up_dir
):
path
=
os
.
path
.
join
(
upgrade_back_up_dir
,
files
)
# 隐藏文件不复制
...
...
@@ -195,6 +206,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym
# 先去重
if
isinstance
(
code_list
,
list
):
code_list
=
list
(
set
(
code_list
))
code_list
=
[
item
.
strip
()
for
item
in
code_list
]
code_list_str
=
' '
.
join
(
code_list
)
elif
code_list
==
'*'
:
code_list_str
=
'*'
...
...
static_file/system_file/load_handle.py
View file @
249157a0
...
...
@@ -37,6 +37,9 @@ if __name__ == '__main__':
with
open
(
'/data/nginx/conf/rpc.conf'
,
'w'
)
as
f
:
f
.
write
(
rpc_conf_content
)
print
(
'删除旧镜像'
)
os
.
system
(
'rm *.tar -f'
)
with
os
.
popen
(
'ls | grep .tar'
)
as
f
:
cmd_txt
=
f
.
read
()
...
...
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