Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
solo-1
Commits
4a8f6cbf
Commit
4a8f6cbf
authored
May 19, 2020
by
vcjmhg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug:fix#119 解决容器异常退出后再次进入后不能够重新启动容器的问题
parent
a3610ca0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
.gitignore
.gitignore
+0
-1
scripts/docker-restart.sh
scripts/docker-restart.sh
+36
-7
No files found.
.gitignore
View file @
4a8f6cbf
...
...
@@ -11,4 +11,3 @@ solo.iml
/.settings/
/.classpath
/.project
local.properties
scripts/docker-restart.sh
View file @
4a8f6cbf
...
...
@@ -7,12 +7,9 @@
# 2. 可将该脚本加入 crontab,每日凌晨运行来实现自动更新
#
isUpdate
=
$(
docker pull b3log/solo|grep
"Downloaded"
)
if
[[
-z
$isUpdate
]]
then
echo
This is the latest version
else
restart_solo
(){
docker stop solo
docker
rm
solo
docker stop solo
docker
rm
solo
docker run
--detach
--name
solo
--network
=
host
\
...
...
@@ -22,4 +19,36 @@ else
--env
JDBC_DRIVER
=
"com.mysql.cj.jdbc.Driver"
\
--env
JDBC_URL
=
"jdbc:mysql://127.0.0.1:3306/solo?useUnicode=yes&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC"
\
b3log/solo
--listen_port
=
8080
--server_scheme
=
http
--server_host
=
localhost
fi
\ No newline at end of file
}
update_solo
(){
isUpdate
=
$(
docker pull b3log/solo|grep
"Downloaded"
)
if
[[
-z
$isUpdate
]]
then
echo
-e
"
\0
33[32m 当前solo为最新版本.
\0
33[0m"
else
restart_solo
>>
/dev/null 2>&1
echo
-e
"
\0
33[32m solo部署成功!!
\0
33[0m"
fi
}
#检查当前容器状态,如果状态正常进行升级操作,否则重新进行部署
update_and_test_service
(){
isCrash
=
$(
docker ps |
grep
"b3log/solo"
)
if
[[
-z
$isCrash
]]
then
echo
-e
"
\0
33[31m solo状态异常,正重新部署...
\0
33[0m"
docker pull b3log/solo
restart_solo
sleep
5
isSecondCrash
=
$(
docker ps |
grep
"b3log/solo"
)
if
[[
-z
$isSecondCrash
]]
then
echo
-e
"
\0
33[31m 重新部署失败,可能原因:solo的启动参数可能有误,请仔细检查!!
\0
33[0m"
fi
else
update_solo
fi
}
update_and_test_service
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