예제 #1
0
// Convert a job to a hipchat payload.
func payloadHipchat(job *database.Job, event, channel string) hipchatPayload {
	msg := message(job, database.NotificationServiceHipchat, event, TypeText)

	return hipchatPayload{
		Color:   "green",
		Notify:  true,
		Format:  "text",
		Room:    channel,
		From:    "LeeroyCI",
		Message: msg,
		Status:  job.Passed(),
	}
}
예제 #2
0
// newStatus returns a status struct with the correct URL and messages.
func newStatus(job *database.Job) *commitStatus {
	state := statusSuccess

	if !job.Passed() {
		state = statusFailed
	}

	return &commitStatus{
		State:       statusMessages[state]["state"],
		TargetURL:   job.URL(),
		Description: statusMessages[state]["description"],
		Context:     "continuous-integration/leeeroyci",
	}
}