Documentation
¶
Index ¶
- Constants
- func GetAttachment(build *gojenkins.Build, message string) slack.MsgOption
- func GetClient(cfg config.Jenkins) (*gojenkins.Jenkins, error)
- func ParseParameters(jobConfig config.JobConfig, parameterString string, params Parameters) error
- func TriggerJenkinsJob(cfg config.JobConfig, jobName string, jobParams map[string]string, ...) error
- func WatchBuild(build *gojenkins.Build) <-chan JobResult
- func WatchJob(jenkins Client, jobName string, stop chan bool) (chan gojenkins.Build, error)
- type Client
- type Job
- type JobResult
- type ParameterModifier
- type Parameters
Constants ¶
const ( IconRunning = "arrows_counterclockwise" IconSuccess = "white_check_mark" IconFailed = "x" )
Variables ¶
This section is empty.
Functions ¶
func GetAttachment ¶
GetAttachment creates a attachment object for a given build
func ParseParameters ¶
func ParseParameters(jobConfig config.JobConfig, parameterString string, params Parameters) error
ParseParameters parse jenkins parameters, based on a input string
func TriggerJenkinsJob ¶
func TriggerJenkinsJob(cfg config.JobConfig, jobName string, jobParams map[string]string, slackClient client.SlackClient, jenkins Client, message msg.Message) error
TriggerJenkinsJob starts a new build with given parameters it will return when the job was started successfully in the background it will watch the current build state and will update the state in the original slack message
func WatchBuild ¶
WatchBuild will return a chan which is filled/closed when the build finished
Types ¶
type Client ¶
type Client interface { GetJob(id string, parentIDs ...string) (*gojenkins.Job, error) BuildJob(name string, options ...interface{}) (int64, error) GetAllNodes() ([]*gojenkins.Node, error) }
Client is a interface of gojenkins.Jenkins
type Job ¶
type Job interface { Poll() (int, error) GetLastBuild() (*gojenkins.Build, error) GetBuild(id int64) (*gojenkins.Build, error) }
Job is a interface of gojenkins.Job
type JobResult ¶ added in v1.6.0
type JobResult struct {
// contains filtered or unexported fields
}
type ParameterModifier ¶
ParameterModifier are functions to mutate given Jenkins parameters e.g. ensure the parameter is a real "boolean" value
type Parameters ¶
Parameters is a simple string map of all build parameters