diff --git a/pkg/apis/devops/v1alpha2/register.go b/pkg/apis/devops/v1alpha2/register.go index f864ada2e..665b67269 100644 --- a/pkg/apis/devops/v1alpha2/register.go +++ b/pkg/apis/devops/v1alpha2/register.go @@ -220,12 +220,12 @@ func addWebService(c *restful.Container) error { Reads([]devops.JenkinsCredential{})) // match Jenkisn api "/blue/rest/organizations/jenkins/pipelines/{projectName}/{pipelineName}" - webservice.Route(webservice.GET("/devops/{projectName}/pipelines/{pipelineName}"). + webservice.Route(webservice.GET("/devops/{devops}/pipelines/{pipelines}"). To(devopsapi.GetPipeline). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get a Pipeline Inside a DevOps Project"). - Param(webservice.PathParameter("pipelineName", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). - Param(webservice.PathParameter("projectName", "the name of devops project.")). + Param(webservice.PathParameter("pipelines", "the name of pipeline, which helps to deliver continuous integration continuous deployment.")). + Param(webservice.PathParameter("devops", "the name of devops project.")). Returns(http.StatusOK, RespOK, devops.Pipeline{}). Writes(devops.Pipeline{})) @@ -752,7 +752,7 @@ func addWebService(c *restful.Container) error { // Gitlab or some other scm managers can only use HTTP method. match /git/notifyCommit/?url= webservice.Route(webservice.POST("/devops/notifycommit"). - To(devopsapi.GetNotifyCommit). + To(devopsapi.PostNotifyCommit). Metadata(restfulspec.KeyOpenAPITags, tags). Doc("Get notify commit by HTTP POST method."). Consumes("application/json"). diff --git a/pkg/apiserver/devops/devops.go b/pkg/apiserver/devops/devops.go index 275635b4f..f4f8bc268 100644 --- a/pkg/apiserver/devops/devops.go +++ b/pkg/apiserver/devops/devops.go @@ -585,6 +585,14 @@ func GetNotifyCommit(req *restful.Request, resp *restful.Response) { resp.Write(res) } +func PostNotifyCommit(req *restful.Request, resp *restful.Response) { + res, err := devops.GetNotifyCommit(req.Request) + if err != nil { + parseErr(err, resp) + return + } + resp.Write(res) +} func GithubWebhook(req *restful.Request, resp *restful.Response) { res, err := devops.GithubWebhook(req.Request) if err != nil { diff --git a/tools/cmd/doc-gen/main.go b/tools/cmd/doc-gen/main.go index 22c20d6ec..e61e57735 100644 --- a/tools/cmd/doc-gen/main.go +++ b/tools/cmd/doc-gen/main.go @@ -26,12 +26,12 @@ import ( "github.com/emicklei/go-restful-openapi" "github.com/go-openapi/spec" "io/ioutil" - _ "kubesphere.io/kubesphere/pkg/apis/iam/install" - _ "kubesphere.io/kubesphere/pkg/apis/logging/install" "kubesphere.io/kubesphere/pkg/apiserver/runtime" "log" // Install apis _ "kubesphere.io/kubesphere/pkg/apis/devops/install" + _ "kubesphere.io/kubesphere/pkg/apis/iam/install" + _ "kubesphere.io/kubesphere/pkg/apis/logging/install" _ "kubesphere.io/kubesphere/pkg/apis/monitoring/install" _ "kubesphere.io/kubesphere/pkg/apis/operations/install" _ "kubesphere.io/kubesphere/pkg/apis/resources/install" @@ -78,7 +78,7 @@ func enrichSwaggerObject(swo *spec.Swagger) { Contact: &spec.ContactInfo{ Name: "kubesphere", Email: "kubesphere@yunify.com", - URL: "kubesphere.io", + URL: "https://kubesphere.io", }, License: &spec.License{ Name: "Apache",