Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tke-eos
Project
Project
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
QA
tke-eos
Commits
055a4386
Commit
055a4386
authored
Mar 03, 2020
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加仓库不存在的异常捕获
parent
7ae296ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
restartLatest.js
app/restartLatest.js
+12
-8
No files found.
app/restartLatest.js
View file @
055a4386
...
@@ -18,7 +18,7 @@ const deploy = async (cluster) => {
...
@@ -18,7 +18,7 @@ const deploy = async (cluster) => {
const
summary
=
{}
const
summary
=
{}
// // for test
// // for test
// const testNamespace = ['
test
']
// const testNamespace = ['
fe
']
// const nsTest = ns.namespaces && ns.namespaces.filter(item => testNamespace.includes(item.name))
// const nsTest = ns.namespaces && ns.namespaces.filter(item => testNamespace.includes(item.name))
// for (const namespace of nsTest) {
// for (const namespace of nsTest) {
for
(
const
namespace
of
ns
.
namespaces
)
{
for
(
const
namespace
of
ns
.
namespaces
)
{
...
@@ -30,14 +30,18 @@ const deploy = async (cluster) => {
...
@@ -30,14 +30,18 @@ const deploy = async (cluster) => {
const
svcs
=
await
getServicesFormat
(
client
.
clientInfo
,
namespace
.
name
)
const
svcs
=
await
getServicesFormat
(
client
.
clientInfo
,
namespace
.
name
)
for
(
const
svc
of
svcs
)
{
for
(
const
svc
of
svcs
)
{
// 重启latest
// 重启latest
if
(
~
svc
.
image
.
indexOf
(
'
latest
'
))
{
if
(
~
svc
.
image
.
indexOf
(
'
latest
'
)
&&
svc
.
serviceName
===
'
admin
'
)
{
logger
.
info
(
'
检查项目
'
,
namespace
.
name
,
svc
.
serviceName
)
logger
.
info
(
'
检查项目
'
,
namespace
.
name
,
svc
.
serviceName
)
const
latest
=
await
container
.
getTagByName
(
`qa-test/
${
svc
.
serviceName
}
`
,
'
latest
'
)
try
{
const
latestImageID
=
_
.
get
(
latest
.
tagInfo
,
'
[0].tagId
'
,
''
)
const
latest
=
await
container
.
getTagByName
(
`qa-test/
${
svc
.
serviceName
}
`
,
'
latest
'
)
if
(
latestImageID
&&
latestImageID
!==
svc
.
imageID
.
split
(
'
@
'
)[
1
])
{
const
latestImageID
=
_
.
get
(
latest
.
tagInfo
,
'
[0].tagId
'
,
''
)
logger
.
info
(
'
latest不一致,部署项目
'
,
namespace
.
name
,
svc
.
podName
)
if
(
latestImageID
&&
latestImageID
!==
svc
.
imageID
.
split
(
'
@
'
)[
1
])
{
summary
[
namespace
.
name
].
latestArray
.
push
(
svc
.
serviceName
)
logger
.
info
(
'
latest不一致,部署项目
'
,
namespace
.
name
,
svc
.
podName
)
await
serviceRestart
(
client
.
clientInfo
,
namespace
.
name
,
svc
.
podName
)
summary
[
namespace
.
name
].
latestArray
.
push
(
svc
.
serviceName
)
await
serviceRestart
(
client
.
clientInfo
,
namespace
.
name
,
svc
.
podName
)
}
}
catch
(
error
)
{
logger
.
warn
(
svc
.
serviceName
,
error
)
}
}
await
sleep
(
5
*
1000
)
await
sleep
(
5
*
1000
)
}
}
...
...
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