Documentation ¶
Overview ¶
Package grim is the "GitHub Responder In MediaMath". We liked the acronym and awkwardly filled in the details to fit it. In short, it is a task runner that is triggered by GitHub push/pull request hooks that is intended as a much simpler and easy-to-use build server than the more modular alternatives (eg. Jenkins). grim provides the library functions to support this use case. grimd is a daemon process that uses the grim library.
Index ¶
Constants ¶
const ( RSPending refStatusState = "pending" RSSuccess refStatusState = "success" RSError refStatusState = "error" RSFailure refStatusState = "failure" )
These statuses model the statuses mentioned here: https://developer.github.com/v3/repos/statuses/#create-a-status
const ( ColorYellow messageColor = "yellow" ColorRed messageColor = "red" ColorGreen messageColor = "green" ColorPurple messageColor = "purple" ColorGray messageColor = "gray" ColorRandom messageColor = "random" )
These colors model the colors mentioned here: https://www.hipchat.com/docs/api/method/rooms/message
Variables ¶
var GrimError = &standardGrimNotification{ RSError, func(c localConfig) string { return c.errorColor() }, func(c localConfig) string { return c.errorTemplate() }, }
GrimError is the notification used for builds that cannot be run correctly.
var GrimFailure = &standardGrimNotification{ RSFailure, func(c localConfig) string { return c.failureColor() }, func(c localConfig) string { return c.failureTemplate() }, }
GrimFailure is the notification used when builds fail.
var GrimPending = &standardGrimNotification{ RSPending, func(c localConfig) string { return c.pendingColor() }, func(c localConfig) string { return c.pendingTemplate() }, }
GrimPending is the notification used for pending builds.
var GrimSuccess = &standardGrimNotification{ RSSuccess, func(c localConfig) string { return c.successColor() }, func(c localConfig) string { return c.successTemplate() }, }
GrimSuccess is the notification used when builds succeed.
Functions ¶
Types ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance models the state of a configured Grim instance.
func (*Instance) BuildNextInGrimQueue ¶
BuildNextInGrimQueue creates or reuses an SQS queue as a source of work.
func (*Instance) PrepareGrimQueue ¶
PrepareGrimQueue creates or reuses the Amazon SQS queue named in the config.
func (*Instance) PrepareRepos ¶
PrepareRepos discovers all repos that are configured then sets up SNS and GitHub. It is an error to call this without calling PrepareGrimQueue first.
func (*Instance) SetConfigRoot ¶
SetConfigRoot sets the base path of the configuration directory and clears any previously read config values from memory.