Documentation
¶
Index ¶
- func GenBuildSpec(jobName string, axisValues map[string]string, suffix string) string
- type BuildInfo
- type BuildInfoAction
- type BuildInfoParameter
- type Jenkins
- func (j *Jenkins) AddBuild(jobName string) error
- func (j *Jenkins) AddBuildWithParameter(jobName string, params url.Values) error
- func (j *Jenkins) AddNodeToJenkins(name, host, description, credentialsId string) error
- func (j *Jenkins) BuildInfo(jobName string, buildNumber int) (*BuildInfo, error)
- func (j *Jenkins) BuildInfoForSpec(buildSpec string) (*BuildInfo, error)
- func (j *Jenkins) CancelOngoingBuild(jobName string, buildNumber int) error
- func (j *Jenkins) CancelQueuedBuild(id string) error
- func (j *Jenkins) FailedTestCasesForBuildSpec(buildSpec string) ([]TestCase, error)
- func (j *Jenkins) IsNodeIdle(node string) (bool, error)
- func (j *Jenkins) LastCompletedBuildStatus(jobName string, axisValues map[string]string) (*BuildInfo, error)
- func (j *Jenkins) MockAPI(suffix, result string)
- func (j *Jenkins) OngoingBuilds(jobName string) (_ []BuildInfo, err error)
- func (j *Jenkins) QueuedBuilds(jobName string) (_ []QueuedBuild, err error)
- func (j *Jenkins) RemoveNodeFromJenkins(node string) error
- type JenkinsMachine
- type JenkinsMachines
- type QueuedBuild
- type QueuedBuildTask
- type TestCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenBuildSpec ¶
GenBuildSpec returns a spec string for the given Jenkins build.
If the main job is a multi-configuration job, the spec is in the form of: <jobName>/axis1Label=axis1Value,axis2Label=axis2Value,.../<suffix> The axis values are taken from the given axisValues map.
If no axisValues are provides, the spec will be: <jobName>/<suffix>.
Types ¶
type BuildInfo ¶
type BuildInfoAction ¶
type BuildInfoAction struct {
Parameters []BuildInfoParameter
}
type BuildInfoParameter ¶
type Jenkins ¶
type Jenkins struct {
// contains filtered or unexported fields
}
func NewForTesting ¶
func NewForTesting() *Jenkins
NewForTesting creates a Jenkins instance in test mode.
func (*Jenkins) AddBuildWithParameter ¶
AddBuildWithParameter adds a parameterized build to the given job.
func (*Jenkins) AddNodeToJenkins ¶
AddNodeToJenkins sends an HTTP request to Jenkins that prompts it to add a new machine to its configuration.
NOTE: Jenkins REST API is not documented anywhere and the particular HTTP request used to add a new machine to Jenkins configuration has been crafted using trial and error.
func (*Jenkins) BuildInfoForSpec ¶
BuildInfoWithBuildURL returns a build's info for the given build's URL.
func (*Jenkins) CancelOngoingBuild ¶
CancelOngoingBuild cancels the ongoing build by given jobName and buildNumber.
func (*Jenkins) CancelQueuedBuild ¶
CancelQueuedBuild cancels the queued build by given id.
func (*Jenkins) FailedTestCasesForBuildSpec ¶
FailedTestCasesForBuildSpec returns failed test cases for the given build spec.
func (*Jenkins) IsNodeIdle ¶
IsNodeIdle checks whether the given node is idle.
func (*Jenkins) LastCompletedBuildStatus ¶
func (j *Jenkins) LastCompletedBuildStatus(jobName string, axisValues map[string]string) (*BuildInfo, error)
LastCompletedBuildStatus returns the most recent completed BuildInfo for the given job.
axisValues can be set to nil if the job is not multi-configuration.
func (*Jenkins) OngoingBuilds ¶
OngoingBuilds returns a slice of BuildInfo for current ongoing builds for the given job.
func (*Jenkins) QueuedBuilds ¶
func (j *Jenkins) QueuedBuilds(jobName string) (_ []QueuedBuild, err error)
QueuedBuilds returns the queued builds.
func (*Jenkins) RemoveNodeFromJenkins ¶
RemoveNodeFromJenkins sends an HTTP request to Jenkins that prompts it to remove an existing machine from its configuration.
type JenkinsMachine ¶
JenkinsMachine stores information about a Jenkins machine.
type JenkinsMachines ¶
type JenkinsMachines struct {
Machines []JenkinsMachine `json:"computer"`
}
JenkinsMachines stores information about Jenkins machines.
type QueuedBuild ¶
type QueuedBuild struct { Id int Params string `json:"params,omitempty"` Task QueuedBuildTask }
func (*QueuedBuild) ParseRefs ¶
func (qb *QueuedBuild) ParseRefs() string
ParseRefs parses refs from a QueuedBuild object's Params field.
type QueuedBuildTask ¶
type QueuedBuildTask struct {
Name string
}