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
5dded53e
Commit
5dded53e
authored
Oct 23, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
markdown 优化
parent
e3d6a886
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
schedule.js
app/schedule.js
+5
-3
No files found.
app/schedule.js
View file @
5dded53e
const
_
=
require
(
'
lodash
'
)
const
schedule
=
require
(
'
node-schedule
'
)
const
request
=
require
(
'
request
'
)
const
moment
=
require
(
'
moment
'
)
...
...
@@ -23,6 +24,7 @@ const dingTalkPush = async function (item, is_recover) {
// const key = `${item.metadata.namespace}:${item.metadata.name}#${item.metadata.labels['qcloud-app']}`
let
message
let
status
const
image
=
_
.
get
(
item
.
spec
.
containers
,
'
[0].image
'
,
''
)
switch
(
item
.
status
.
conditions
.
length
)
{
case
1
:
message
=
item
.
status
.
conditions
[
0
].
reason
...
...
@@ -46,7 +48,6 @@ const dingTalkPush = async function (item, is_recover) {
title
:
'
pipeline项目添加信息如下
'
,
text
:
'
> 描述信息 : 腾讯云服务---恢复正常通知
\n\n
'
+
`> 项目名称 :
${
item
.
metadata
.
labels
[
'
qcloud-app
'
]}
\n\n`
+
`> 项目类型 :
${
item
.
metadata
.
labels
.
type
}
\n\n`
+
`> 命名空间 :
${
item
.
metadata
.
namespace
}
\n\n`
+
`> 恢复时间 :
${
moment
()
.
format
(
'
YYYY-MM-DD HH:mm:ss
'
)}
\n\n`
,
...
...
@@ -55,14 +56,15 @@ const dingTalkPush = async function (item, is_recover) {
msgtype
:
'
markdown
'
,
markdown
:
{
title
:
'
pipeline项目添加信息如下
'
,
text
:
'
> 描述信息 : 腾讯云服务---异常提醒通知
\n\n
'
text
:
'
>
<font color=#FF0000>
描述信息 : 腾讯云服务---异常提醒通知
\n\n
'
+
`> 项目名称 :
${
item
.
metadata
.
labels
[
'
qcloud-app
'
]}
\n\n`
+
`> <font color=#FF0000> 项目分支 :
${
image
}
\n\n`
+
`> 项目类型 :
${
item
.
metadata
.
labels
.
type
}
\n\n`
+
`> 命名空间 :
${
item
.
metadata
.
namespace
}
\n\n`
+
`> 异常原因 :
${
message
}
\n\n`
+
`> 异常时间 :
${
moment
()
.
format
(
'
YYYY-MM-DD HH:mm:ss
'
)}
\n\n`
+
`[
查看详情
](http://qa2.liangkebang.com/dockers/runingEnv/
${
item
.
metadata
.
namespace
}
)`
,
+
`[
点击查看
](http://qa2.liangkebang.com/dockers/runingEnv/
${
item
.
metadata
.
namespace
}
)`
,
},
};
await
awaitRequest
({
...
...
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