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

@@ -340,8 +340,21 @@ func ScanBranch(projectName, pipelineName string, req *http.Request) ([]byte, er
return resBody, err
}
func RunPipeline(projectName, pipelineName, branchName string, req *http.Request) ([]byte, error) {
baseUrl := fmt.Sprintf(jenkins.Server+RunPipelineUrl+req.URL.RawQuery, projectName, pipelineName, branchName)
func RunBranchPipeline(projectName, pipelineName, branchName string, req *http.Request) ([]byte, error) {
baseUrl := fmt.Sprintf(jenkins.Server+RunBranchPipelineUrl+req.URL.RawQuery, projectName, pipelineName, branchName)
log.Infof("Jenkins-url: " + baseUrl)
res, err := sendJenkinsRequest(baseUrl, req)
if err != nil {
log.Error(err)
return nil, err
}
return res, err
}
func RunPipeline(projectName, pipelineName string, req *http.Request) ([]byte, error) {
baseUrl := fmt.Sprintf(jenkins.Server+RunPipelineUrl+req.URL.RawQuery, projectName, pipelineName)
log.Infof("Jenkins-url: " + baseUrl)
res, err := sendJenkinsRequest(baseUrl, req)