Documentation
¶
Index ¶
- func GetAttachment(build *gojenkins.Build, message string) slack.MsgOption
- func ParseParameters(jobConfig config.JobConfig, parameterString string, params Parameters) error
- func TriggerJenkinsJob(cfg config.JobConfig, jobName string, jobParams Parameters, ...) error
- func WatchBuild(build *gojenkins.Build) <-chan JobResult
- func WatchJob(ctx context.Context, jenkins Client, jobName string, stop chan bool) (chan gojenkins.Build, error)
- type Client
- type Job
- type JobResult
- type ParameterModifier
- type Parameters
Constants ¶
This section is empty.
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 Parameters, 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(ctx context.Context, id string) (*gojenkins.Job, error) BuildJob(ctx context.Context, name string, params map[string]string) (int64, error) GetAllNodes(ctx context.Context) ([]*gojenkins.Node, error) }
Client is an interface representing used jenkins functions of gojenkins.
type Job ¶
type Job interface { Poll(ctx context.Context) (int, error) GetLastBuild(ctx context.Context) (*gojenkins.Build, error) GetBuild(ctx context.Context, id int64) (*gojenkins.Build, error) }
Job is a interface of gojenkins.Job
type JobResult ¶
type JobResult struct {
// contains filtered or unexported fields
}
JobResult holds the build result of a Build
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
func (Parameters) String ¶
func (p Parameters) String() string