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
70269312
Commit
70269312
authored
Mar 13, 2020
by
金凯强
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级的时候 顺便把环境变量文件上传过去
parent
49aaf8d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
upgrade_service.py
app/upgrade/upgrade_service.py
+2
-1
load_handle.py
static_file/system_file/load_handle.py
+3
-3
No files found.
app/upgrade/upgrade_service.py
View file @
70269312
...
...
@@ -9,7 +9,7 @@ from app.conncetion.conncetion_service import ConnectionService
from
app.info.info_service
import
docker_client
from
app.utils.db_tools
import
db_driver
from
app.utils.ssh_tools
import
SSHConnect
from
static_file
import
back_up_dir
,
builds_dir
,
temp_file_dir
,
system_file_dir
from
static_file
import
back_up_dir
,
builds_dir
,
temp_file_dir
,
system_file_dir
,
profile_dir
class
UpgradeService
():
...
...
@@ -134,6 +134,7 @@ docker-compose -f /data/upgrade_tools_data/backup/{upgrade_no}/docker-compose.ym
ssh
.
upload
(
path
,
f
'/huansi/upgrade/{files}'
)
ssh
.
upload
(
os
.
path
.
join
(
system_file_dir
,
'load.sh'
),
'/huansi/upgrade/load.sh'
)
ssh
.
upload
(
os
.
path
.
join
(
profile_dir
,
'huansi.sh'
),
'/huansi/upgrade/huansi.sh'
)
ssh
.
upload
(
os
.
path
.
join
(
system_file_dir
,
'load_handle.py'
),
'/huansi/upgrade/load_handle.py'
)
out
,
err
=
ssh
.
exec_command
(
"sh /huansi/upgrade/load.sh"
)
...
...
static_file/system_file/load_handle.py
View file @
70269312
...
...
@@ -35,11 +35,11 @@ if __name__ == '__main__':
if
app_str
==
'*'
:
res
=
os
.
system
(
'''export HUANSI_REGISTRY_URL=47.110.145.204:8084 &&
\
source /
etc/profile.d
/huansi.sh &&
\
docker-compose
up -p deploy
-d --force-recreate'''
)
source /
huansi/upgrade
/huansi.sh &&
\
docker-compose
-p deploy up
-d --force-recreate'''
)
else
:
res
=
os
.
system
(
'''export HUANSI_REGISTRY_URL=47.110.145.204:8084 &&
\
source /
etc/profile.d
/huansi.sh &&
\
source /
huansi/upgrade
/huansi.sh &&
\
docker-compose -p deploy up -d --force-recreate --no-deps {}'''
.
format
(
app_str
))
if
res
==
1
:
raise
RuntimeError
(
'程序升级失败'
)
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