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
1d71b0f2
Commit
1d71b0f2
authored
Apr 30, 2020
by
智勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复RepoNotExist
parent
9d9cc7d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
pipeline.js
app/controller/pipeline.js
+4
-5
No files found.
app/controller/pipeline.js
View file @
1d71b0f2
...
@@ -179,8 +179,7 @@ const findPipes = async function (ctx) {
...
@@ -179,8 +179,7 @@ const findPipes = async function (ctx) {
}
}
const
getImageData
=
async
(
svcName
,
cluster
)
=>
{
const
getImageData
=
async
(
svcName
,
cluster
)
=>
{
const
proConfig
=
await
ProConfig
.
getOneProject
({
project_name
:
svcName
},
{
type
:
1
})
const
params
=
{
reponame
:
`qa-test/
${
svcName
}
`
}
const
params
=
{
reponame
:
`qa-
${
proConfig
.
type
}
/
${
svcName
}
`
}
const
imageData
=
await
awaitRequest
({
const
imageData
=
await
awaitRequest
({
url
:
`
${
config
.
api
.
tke_api
}
/tag`
,
url
:
`
${
config
.
api
.
tke_api
}
/tag`
,
method
:
'
POST
'
,
method
:
'
POST
'
,
...
@@ -190,7 +189,7 @@ const getImageData = async (svcName, cluster) => {
...
@@ -190,7 +189,7 @@ const getImageData = async (svcName, cluster) => {
},
},
body
:
JSON
.
stringify
(
params
),
body
:
JSON
.
stringify
(
params
),
})
})
return
imageData
.
data
return
imageData
&&
imageData
.
data
}
}
const
save
=
async
function
(
ctx
)
{
const
save
=
async
function
(
ctx
)
{
...
@@ -202,9 +201,9 @@ const save = async function (ctx) {
...
@@ -202,9 +201,9 @@ const save = async function (ctx) {
branchInfo
=
branchInfo
.
filter
(
i
=>
i
.
name
===
item
.
ref
.
name
)
branchInfo
=
branchInfo
.
filter
(
i
=>
i
.
name
===
item
.
ref
.
name
)
if
(
branchInfo
.
length
>
0
)
{
if
(
branchInfo
.
length
>
0
)
{
let
imageData
=
await
getImageData
(
item
.
repository
,
data
.
cluster
)
let
imageData
=
await
getImageData
(
item
.
repository
,
data
.
cluster
)
imageData
=
imageData
.
tagInfo
.
filter
(
i
=>
i
.
tagName
.
indexOf
(
item
.
ref
.
name
.
split
(
'
-
'
)[
0
])
!==
-
1
)
imageData
=
imageData
&&
imageData
.
tagInfo
.
filter
(
i
=>
i
.
tagName
.
indexOf
(
item
.
ref
.
name
.
split
(
'
-
'
)[
0
])
!==
-
1
)
// 如果还没有当前分支的镜像,或者提交时间比镜像制作时间晚时,触发jenkins
// 如果还没有当前分支的镜像,或者提交时间比镜像制作时间晚时,触发jenkins
if
(
imageData
.
length
===
0
||
branchInfo
[
0
].
commit
.
committed_date
.
replace
(
'
T
'
,
'
'
)
>
imageData
[
0
].
updateTime
)
{
if
(
!
imageData
||
imageData
.
length
===
0
||
branchInfo
[
0
].
commit
.
committed_date
.
replace
(
'
T
'
,
'
'
)
>
imageData
[
0
].
updateTime
)
{
const
buildData
=
{
const
buildData
=
{
projectName
:
item
.
repository
,
projectName
:
item
.
repository
,
branchName
:
item
.
ref
.
name
,
branchName
:
item
.
ref
.
name
,
...
...
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