Documentation
¶
Index ¶
- Variables
- type Build
- type Client
- func (s *Client) Build(ctx context.Context, j *Job) (int64, error)
- func (s *Client) Do(req *http.Request) (*http.Response, error)
- func (s *Client) GetBuildFromQueueItemID(ctx context.Context, queueItemID int64) (*Build, error)
- func (s *Client) GetBuildURL(ctx context.Context, queueItemID int64) (string, error)
- func (s *Client) String() string
- type Job
- type JobTemplate
- type TemplateData
Constants ¶
This section is empty.
Variables ¶
var ErrBuildScheduled = errors.New("build scheduled, build not available yet")
Functions ¶
This section is empty.
Types ¶
type Build ¶ added in v0.3.0
func ParseBuildURL ¶ added in v0.3.0
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a HTTP API client for a Jenkins Server.
func (*Client) Build ¶
Build schedules a build of the job. On success it returns the ID of the queued build item and nil. On errors where retrying might lead to positive result a goorderr.RetryableError is returned.
func (*Client) GetBuildFromQueueItemID ¶ added in v0.3.0
GetBuildFromQueueItemID does the same than [s.GetBuildURL] but returns a Build instead of the URL as string.
func (*Client) GetBuildURL ¶ added in v0.3.0
On errors where retrying might lead to positive result a goorderr.RetryableError is returned. This includes the case when a queued item exist but no build number has been assigned yet. A goorderr.RetryableError wrapping ErrBuildScheduled is returned.
The queued item URL expires 5 minutes after the item got a build number assigned and jenkins will responds with a 404 status code. The method will return an error.
type JobTemplate ¶
JobTemplate is a Job definition that can contain Go-Template statements.
func (*JobTemplate) Template ¶
func (j *JobTemplate) Template(data TemplateData) (*Job, error)
Template creates a concrete Job from j by templating it with [templateData] and [templateFuncs.