Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-api
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
1
Merge Requests
1
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
qa-api
Commits
ebf63fac
Commit
ebf63fac
authored
Nov 23, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sonar jenkins取消判断
parent
4b2e174c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
pipeline.js
app/controller/pipeline.js
+9
-8
sonar.js
app/controller/sonar.js
+1
-1
No files found.
app/controller/pipeline.js
View file @
ebf63fac
...
@@ -106,13 +106,14 @@ const webhooks = async function (ctx) {
...
@@ -106,13 +106,14 @@ const webhooks = async function (ctx) {
const
commitMes
=
req
.
commits
[
0
].
message
const
commitMes
=
req
.
commits
[
0
].
message
const
timestamp
=
req
.
commits
[
0
].
timestamp
const
timestamp
=
req
.
commits
[
0
].
timestamp
const
project
=
await
ProConfig
.
getOneProject
({
project_name
:
projectName
})
// const project = await ProConfig.getOneProject({ project_name: projectName })
if
(
project
.
sonar
)
{
// if (project.sonar) {
logger
.
info
(
'
webhooks 触发 sonar jenkins build
'
,
projectName
,
branchName
,
req
.
checkout_sha
)
sonarJenkinsBuild
({
// }
projectName
,
branchName
,
branchHash
:
req
.
checkout_sha
,
gitUser
,
commitMes
,
logger
.
info
(
'
webhooks 触发 sonar jenkins build
'
,
projectName
,
branchName
,
req
.
checkout_sha
)
})
sonarJenkinsBuild
({
}
projectName
,
branchName
,
branchHash
:
req
.
checkout_sha
,
gitUser
,
commitMes
,
})
const
data
=
await
PipeLine
.
getMatchPipe
(
projectName
)
const
data
=
await
PipeLine
.
getMatchPipe
(
projectName
)
// 获取项目的分类
// 获取项目的分类
...
@@ -126,7 +127,7 @@ const webhooks = async function (ctx) {
...
@@ -126,7 +127,7 @@ const webhooks = async function (ctx) {
}
}
}
}
if
(
gitObject
==
null
||
gitObject
===
undefined
)
{
if
(
gitObject
==
null
||
gitObject
===
undefined
)
{
logger
.
info
(
`未查询到订阅信息->>>项目名:
${
projectName
}
分支名:
${
branchName
}
,不执行jenkins`
)
logger
.
info
(
`未查询到订阅信息->>>项目名:
${
projectName
}
分支名:
${
branchName
}
,不执行
pipeline
jenkins`
)
}
else
{
}
else
{
logger
.
info
(
'
webhooks 触发 pipeline jenkins build
'
,
projectName
,
branchName
,
req
.
checkout_sha
)
logger
.
info
(
'
webhooks 触发 pipeline jenkins build
'
,
projectName
,
branchName
,
req
.
checkout_sha
)
pipelineJenkinsBuild
({
pipelineJenkinsBuild
({
...
...
app/controller/sonar.js
View file @
ebf63fac
...
@@ -36,7 +36,7 @@ const sendExceptionDing = async (data) => {
...
@@ -36,7 +36,7 @@ const sendExceptionDing = async (data) => {
}
}
const
sendExistDing
=
async
(
data
,
dingRobotAddr
)
=>
{
const
sendExistDing
=
async
(
data
,
dingRobotAddr
)
=>
{
const
text
=
'
> <font color=#FF7F50> 本次执行的GITHASH曾经扫描过
'
const
text
=
'
> <font color=#FF7F50> 本次执行的GITHASH曾经扫描过
\n\n
'
+
`> 扫描结果 :
${
data
.
sonarResult
}
\n\n`
+
`> 扫描结果 :
${
data
.
sonarResult
}
\n\n`
+
`> <font color=#000000> 项目名称 :
${
data
.
projectName
}
\n\n`
+
`> <font color=#000000> 项目名称 :
${
data
.
projectName
}
\n\n`
+
`> 分支名称 :
${
data
.
branchName
}
\n\n`
+
`> 分支名称 :
${
data
.
branchName
}
\n\n`
...
...
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