update post run pipeline

Signed-off-by: soulseen <sunzhu@yunify.com>
This commit is contained in:
Zhuxiaoyang
2019-05-08 21:01:45 +08:00
committed by GitHub
parent 3aba5b15f4
commit 52b63f5ebc
4 changed files with 46 additions and 7 deletions

View File

@@ -359,12 +359,26 @@ func ScanBranch(req *restful.Request, resp *restful.Response) {
resp.Write(res)
}
func RunPipeline(req *restful.Request, resp *restful.Response) {
func RunBranchPipeline(req *restful.Request, resp *restful.Response) {
projectName := req.PathParameter("projectName")
pipelineName := req.PathParameter("pipelineName")
branchName := req.PathParameter("branchName")
res, err := devops.RunPipeline(projectName, pipelineName, branchName, req.Request)
res, err := devops.RunBranchPipeline(projectName, pipelineName, branchName, req.Request)
if err != nil {
parseErr(err, resp)
return
}
resp.Header().Set(restful.HEADER_ContentType, restful.MIME_JSON)
resp.Write(res)
}
func RunPipeline(req *restful.Request, resp *restful.Response) {
projectName := req.PathParameter("projectName")
pipelineName := req.PathParameter("pipelineName")
res, err := devops.RunPipeline(projectName, pipelineName, req.Request)
if err != nil {
parseErr(err, resp)
return