-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(api): add APIs for getting pipeline templates and detecting repo type #557
Conversation
/hold |
/hold cancel |
/cc @supereagle |
config/templates/templates.yaml
Outdated
npm run build | ||
customizedDockerfile: | | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ---
instead of blank line to separate.
docs/api/v1/api.md
Outdated
|
||
| API | Path | Detail | | ||
| --- | --- | --- | | ||
| List | GET `/api/v1/templates` | WIP, [link](#list-templates) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use pipelinetemplates
, as maybe need to support other templates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have fixed
docs/api/v1/api.md
Outdated
|
||
| Field | Note | | ||
| --- | --- | | ||
| repo | Required, repo for which the tags will be listed | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have fixed
pkg/scm/provider/gitlab/gitlabv3.go
Outdated
language := getTopLanguage(languages) | ||
|
||
switch language { | ||
case api.JavaRepoType: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some duplicated code. What about?
switch language {
case api.JavaRepoType,api.JavaScriptRepoType:
files, err := getContents(g.scmCfg, v3APIVersion, repo)
if err != nil {
log.Error("get contents failed:%v", err)
return language, nil
}
for _, f := range files {
if strings.Contains(f.Name, "pom.xml") {
return api.MavenRepoType, nil
}
if strings.Contains(f.Name, "build.gradle") {
return api.GradleRepoType, nil
}
if strings.Contains(f.Name, "package.json") {
return api.NodeRepoType, nil
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
config/templates/templates.yaml
Outdated
customizedDockerfile: | | ||
FROM jboss/base-jdk:8 | ||
|
||
MAINTAINER cyclone "cyclone@caicloud.io" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有这个邮箱吗。。。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol, i don't know, have deleted it.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: supereagle The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Add your description
Which issue(s) this PR is related to (optional, link to 3rd issue(s)):
Fixes #
Reference to #
Special notes for your reviewer:
/cc @
Release note: