Documentation ¶
Index ¶
Constants ¶
const ( Succeess = "SUCCESS" Failure = "FAILURE" Aborted = "ABORTED" )
Variables ¶
This section is empty.
Functions ¶
func RunAfterSuccessCanRun ¶
RunAfterSuccessCanRun returns whether a child job (specified as run_after_success in the prow config) can run once its parent job succeeds. The only case we will not run a child job is when it is a presubmit job and has a run_if_changed regural expression specified which does not match the changed filenames in the pull request the job was meant to run for. TODO: Collapse with plank, impossible to reuse as is due to the interfaces.
Types ¶
type AuthConfig ¶
type AuthConfig struct { Basic *BasicAuthConfig BearerToken *BearerTokenAuthConfig }
AuthConfig configures how we auth with Jenkins. Only one of the fields will be non-nil.
type BasicAuthConfig ¶
type BearerTokenAuthConfig ¶
type BearerTokenAuthConfig struct {
Token string
}
type Client ¶
type Client struct { // If Logger is non-nil, log all method calls with it. Logger Logger // contains filtered or unexported fields }
func NewClient ¶
func NewClient(url string, authConfig *AuthConfig) *Client
func (*Client) Abort ¶
func (c *Client) Abort(job string, build *JenkinsBuild) error
Abort aborts the provided Jenkins build for job. Only running builds are aborted.
func (*Client) Build ¶
Build triggers a Jenkins build for the provided ProwJob. The name of the ProwJob is going to be used as the buildId parameter that will help us track the build before it's scheduled by Jenkins.
func (*Client) ListJenkinsBuilds ¶
func (c *Client) ListJenkinsBuilds(jobs map[string]struct{}) (map[string]JenkinsBuild, error)
ListJenkinsBuilds returns a list of all in-flight builds for the provided jobs. Both running and unscheduled builds will be returned.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller manages ProwJobs.
func NewController ¶
NewController creates a new Controller from the provided clients.
type JenkinsBuild ¶
type JenkinsBuild struct { Actions []struct { Parameters []struct { Name string `json:"name"` // This needs to be an interface so we won't clobber // json unmarshaling when the Jenkins job has more // parameter types than strings. Value interface{} `json:"value"` } `json:"parameters"` } `json:"actions"` Task struct { // Used for tracking unscheduled builds for jobs. Name string `json:"name"` } `json:"task"` Number int `json:"number"` Result *string `json:"result"` // contains filtered or unexported fields }
func (*JenkinsBuild) BuildID ¶
func (jb *JenkinsBuild) BuildID() string
func (*JenkinsBuild) IsEnqueued ¶
func (jb *JenkinsBuild) IsEnqueued() bool
func (*JenkinsBuild) IsFailure ¶
func (jb *JenkinsBuild) IsFailure() bool
func (*JenkinsBuild) IsRunning ¶
func (jb *JenkinsBuild) IsRunning() bool
func (*JenkinsBuild) IsSuccess ¶
func (jb *JenkinsBuild) IsSuccess() bool