fix create pipeline error

fix get pipelinerun list

feature kapi for devopsproject pipeline credential

fix get pipelinebranch

fix create credential api

Signed-off-by: shaowenchen <mail@chenshaowen.com>
This commit is contained in:
shaowenchen
2020-05-14 15:31:50 +08:00
parent 0d12529051
commit 11b72a8817
16 changed files with 746 additions and 154 deletions

View File

@@ -233,6 +233,7 @@ func (j *Jenkins) CreateCredentialInProject(projectId string, credential *v1.Sec
if err != nil {
return "", err
}
if response.StatusCode != http.StatusOK {
return "", errors.New(strconv.Itoa(response.StatusCode))
}

View File

@@ -407,7 +407,7 @@ func (j *Jenkins) ListPipelineRuns(projectName, pipelineName string, httpParamet
PipelineOjb := &Pipeline{
HttpParameters: httpParameters,
Jenkins: j,
Path: ListPipelineRunUrl + httpParameters.Url.RawQuery,
Path: fmt.Sprintf(ListPipelineRunUrl, projectName, pipelineName) + httpParameters.Url.RawQuery,
}
res, err := PipelineOjb.ListPipelineRuns()
return res, err

View File

@@ -145,7 +145,7 @@ func (p *Pipeline) ListPipelineRuns() (*devops.PipelineRunList, error) {
}
var pipelineRunList devops.PipelineRunList
err = json.Unmarshal(res, &pipelineRunList)
err = json.Unmarshal(res, &pipelineRunList.Items)
if err != nil {
klog.Error(err)
return nil, err