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
8ad6bfef
Commit
8ad6bfef
authored
Nov 08, 2019
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目管理校验
parent
7287b8f7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
7 deletions
+13
-7
pipeline.js
app/controller/pipeline.js
+5
-4
proconfig.js
app/controller/proconfig.js
+6
-0
user.js
app/controller/user.js
+1
-1
server.js
bin/server.js
+1
-2
No files found.
app/controller/pipeline.js
View file @
8ad6bfef
...
@@ -42,7 +42,7 @@ const jenkinsBuild = async function (gitObject, gitUser, commitMes, timestamp) {
...
@@ -42,7 +42,7 @@ const jenkinsBuild = async function (gitObject, gitUser, commitMes, timestamp) {
commitMes
,
commitMes
,
projectName
:
gitObject
.
repository
,
projectName
:
gitObject
.
repository
,
gitUser
,
gitUser
,
gitEventTime
:
timestamp
,
gitEventTime
:
timestamp
||
moment
().
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
,
}
}
await
PipeLinePush
.
savePipesPush
(
store
)
await
PipeLinePush
.
savePipesPush
(
store
)
}
}
...
@@ -128,9 +128,10 @@ const findPipes = async function (ctx) {
...
@@ -128,9 +128,10 @@ const findPipes = async function (ctx) {
const
save
=
async
function
(
ctx
)
{
const
save
=
async
function
(
ctx
)
{
const
data
=
ctx
.
request
.
body
const
data
=
ctx
.
request
.
body
await
PipeLine
.
savePipes
(
data
)
await
PipeLine
.
savePipes
(
data
)
logger
.
info
(
'
save pipeline application
'
,
data
)
for
(
const
item
of
data
.
repos
)
{
for
(
const
item
of
data
.
repos
)
{
logger
.
info
(
'
save pipeline application
'
,
item
)
logger
.
info
(
'
jenkinsBuild on save pipeline application
'
,
data
.
application_name
,
item
)
jenkinsBuild
(
item
,
'
qahome
'
,
'
save pipeline application
'
,
moment
().
format
(
'
YYYY-MM-DD HH:mm:ss
'
)
)
jenkinsBuild
(
item
,
data
.
update_user
||
data
.
new_user
,
'
save pipeline application
'
)
}
}
ctx
.
body
=
ctx
.
ok
(
'
ok
'
)
ctx
.
body
=
ctx
.
ok
(
'
ok
'
)
}
}
...
@@ -150,7 +151,7 @@ const sendData = async (namespace, projectName, branchName, gitUser, flag, messa
...
@@ -150,7 +151,7 @@ const sendData = async (namespace, projectName, branchName, gitUser, flag, messa
+
`> 部署空间 :
${
namespace
}
\n\n`
+
`> 部署空间 :
${
namespace
}
\n\n`
+
`> 触发同学 :
${
gitUser
}
\n\n`
+
`> 触发同学 :
${
gitUser
}
\n\n`
+
`> 触发时间 :
${
moment
().
format
(
'
YYYY-MM-DD HH:mm:ss
'
)}
\n\n`
+
`> 触发时间 :
${
moment
().
format
(
'
YYYY-MM-DD HH:mm:ss
'
)}
\n\n`
+
`>
提交
信息 :
${
message
}
\n\n`
+
`>
触发
信息 :
${
message
}
\n\n`
+
`#### 结果 :
${
flag
===
'
success
'
?
'
成功
'
:
'
失败
'
}
[查看详情](
${
url
}${
type
}
/
${
buildNumber
}
/)`
,
+
`#### 结果 :
${
flag
===
'
success
'
?
'
成功
'
:
'
失败
'
}
[查看详情](
${
url
}${
type
}
/
${
buildNumber
}
/)`
,
},
},
}
}
...
...
app/controller/proconfig.js
View file @
8ad6bfef
...
@@ -46,6 +46,12 @@ const save = async function (ctx) {
...
@@ -46,6 +46,12 @@ const save = async function (ctx) {
ctx
.
body
=
ctx
.
fail
(
ctx
.
Code
.
ERROR_GITPATH
)
ctx
.
body
=
ctx
.
fail
(
ctx
.
Code
.
ERROR_GITPATH
)
return
return
}
}
if
(
~
data
.
host_name
.
indexOf
(
'
://
'
))
{
ctx
.
body
=
ctx
.
fail
(
'
线上域名不要有 http://
'
)
return
}
data
.
git_lab
=
match
[
1
]
data
.
git_lab
=
match
[
1
]
data
.
git_path_group
=
match
[
2
]
data
.
git_path_group
=
match
[
2
]
data
.
project_name
=
match
[
3
]
data
.
project_name
=
match
[
3
]
...
...
app/controller/user.js
View file @
8ad6bfef
...
@@ -12,7 +12,7 @@ const authenticate = require('../service/authenticate')
...
@@ -12,7 +12,7 @@ const authenticate = require('../service/authenticate')
const
router
=
new
Router
()
const
router
=
new
Router
()
const
admin
=
[
'
zhijie.xue
'
,
'
luoyong.meng
'
,
'
kewei.jia
'
,
'
hui.hu
'
,
'
yong.zhi
'
]
const
admin
=
[
'
zhijie.xue
'
,
'
luoyong.meng
'
,
'
kewei.jia
'
,
'
hui.hu
'
,
'
yong.zhi
'
,
'
haiyuan.wen
'
]
const
login
=
async
function
(
ctx
)
{
const
login
=
async
function
(
ctx
)
{
const
{
body
}
=
ctx
.
request
const
{
body
}
=
ctx
.
request
...
...
bin/server.js
View file @
8ad6bfef
...
@@ -21,8 +21,7 @@ const logger = log4js.getLogger()
...
@@ -21,8 +21,7 @@ const logger = log4js.getLogger()
require
(
'
../app/service/mongoService
'
)
require
(
'
../app/service/mongoService
'
)
require
(
'
../app/service/redisService
'
)
require
(
'
../app/service/redisService
'
)
require
(
'
../app/jobs
'
)
// require('../app/jobs')
const
logFormat
=
'
:req[x-real-ip] :req[x-forwarded-for] - -
'
const
logFormat
=
'
:req[x-real-ip] :req[x-forwarded-for] - -
'
+
'
":method :url HTTP/:http-version"
'
+
'
":method :url HTTP/:http-version"
'
...
...
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