Commit 5c9866cf authored by Raúl Sánchez Ruiz's avatar Raúl Sánchez Ruiz Committed by Sander van Harmelen

Add support to Jenkins Integration (#302)

* Add release_description to tag

* Add Create/Update/Get Jenkins Service

* add support for paginate options in list tag
parent e987efed
......@@ -418,3 +418,67 @@ func (s *ServicesService) DeleteJiraService(pid interface{}, options ...OptionFu
return s.client.Do(req, nil)
}
// SetJenkinsCIServiceOptions represents the available SetJenkinsCIService()
// options.
//
type SetJenkinsCIServiceOptions struct {
URL *string `url:"jenkins_url" json:"jenkins_url" `
ProjectName *string `url:"project_name" json:"project_name" `
Username *string `url:"username" json:"username"`
Password *string `url:"password" json:"password"`
}
// SetJenkinsCIService sets Jenkins service for a project
//
//
func (s *ServicesService) SetJenkinsCIService(pid interface{}, opt *SetJenkinsCIServiceOptions, options ...OptionFunc) (*Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, err
}
u := fmt.Sprintf("projects/%s/services/jenkins", url.QueryEscape(project))
req, err := s.client.NewRequest("PUT", u, opt, options)
if err != nil {
return nil, err
}
return s.client.Do(req, nil)
}
// JenkinsCIServiceProperties represents Jenkins CI specific properties.
type JenkinsCIServiceProperties struct {
URL *string `url:"jenkins_url" json:"jenkins_url" `
ProjectName *string `url:"project_name" json:"project_name" `
Username *string `url:"username" json:"username"`
}
// JenkinsCIService represents Jenkins CI service settings.
type JenkinsCIService struct {
Service
Properties *JenkinsCIServiceProperties `json:"properties"`
}
// GetJenkinsCIService gets Jenkins CI service settings for a project.
//
func (s *ServicesService) GetJenkinsCIService(pid interface{}, options ...OptionFunc) (*JenkinsCIService, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("projects/%s/services/jenkins", url.QueryEscape(project))
req, err := s.client.NewRequest("GET", u, nil, options)
if err != nil {
return nil, nil, err
}
opt := new(JenkinsCIService)
resp, err := s.client.Do(req, opt)
if err != nil {
return nil, resp, err
}
return opt, resp, err
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment