Documentation ¶
Index ¶
- func Clone(recipe *common.Recipe) (string, error)
- func ConfigureTasks(amount int)
- func Enqueue(r common.Recipe)
- func IsBitBucketMerge(r common.Recipe, payload []byte) bool
- func IsGithubMerge(r common.Recipe, payload []byte) bool
- func IsManualTrigger(r common.Recipe, payload []byte) bool
- func RunRecipe(recipe common.Recipe) bool
- func RunTask(index int)
- type BBActor
- type BBPushDetails
- type BBPushEvent
- type BBReferenceState
- type BBRepository
- type GHPushEvent
- type GHPusher
- type GHRepository
- type GHSender
- type ManualTrigger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Clone ¶
Clone uses go-git library to single-branch clone the repository of the provided Recipe.
Returns the final path the the repo was checked out
func ConfigureTasks ¶
func ConfigureTasks(amount int)
ConfigureTasks prepares the builder to be ready for picking up work
func IsBitBucketMerge ¶
IsBitBucketMerge checks whether the provided Recipe matches the BitBucket payload of the hook request.
func IsGithubMerge ¶
IsGithubMerge checks whether the provided Recipe matches the Github payload of the hook request.
func IsManualTrigger ¶
IsManualTrigger detects a dummy payload that forces build of the recipe.
Types ¶
type BBActor ¶
type BBActor struct { DisplayName string `json:"display_name"` UUID string `json:"uuid"` AccountID string `json:"account_id"` Nickname string `json:"nickname"` Type string `json:"type"` }
BBActor contains more details about the person that triggered the push
type BBPushDetails ¶
type BBPushDetails struct { Changes []struct { Forced bool `json:"forced"` // Force Push Created bool `json:"created"` Truncated bool `json:"truncated"` // whether BB truncated the commits array in this payload. Closed bool `json:"closed"` // An object containing information about the state // of the reference before the push. When a branch // is created, old is null. Old *BBReferenceState `json:"old"` // An object containing information about the state // of the reference after the push. When a branch is // deleted, new is null. New *BBReferenceState `json:"new"` } `json:"changes"` }
BBPushDetails contains all the details and references of the push.
type BBPushEvent ¶
type BBPushEvent struct { Push BBPushDetails `json:"push"` Actor BBActor `json:"actor"` Repository BBRepository `json:"repository"` }
BBPushEvent represents a Push of changes either new branch or a merge etc
https://confluence.atlassian.com/bitbucket/event-payloads-740262817.html#EventPayloads-Push
type BBReferenceState ¶
type BBReferenceState struct { Name string `json:"name"` Type string `json:"type"` Target struct { Hash string `json:"hash"` Type string `json:"type"` Date string `json:"date"` Message string `json:"message"` Author struct { Type string `json:"type"` Raw string `json:"raw"` } `json:"author"` } `json:"target"` }
BBReferenceState contains state of the reference It is used in BBPushDetails to capture the state before (old) the push and after (new) it.
type BBRepository ¶
type BBRepository struct { SCM string `json:"scm"` Website *string `json:"website"` Name string `json:"name"` FullName string `json:"full_name"` Owner BBActor `json:"owner"` Type string `json:"type"` IsPrivate bool `json:"is_private"` UUID string `json:"uuid"` }
BBRepository contains really basic info about the BitBucket repository. It is contained in most webhook payloads.
type GHPushEvent ¶
type GHPushEvent struct { Ref string `json:"ref"` SHAHead string `json:"head"` SHABefore string `json:"before"` Size int `json:"size"` DistinctSize int `json:"distinct_size"` Repository GHRepository `json:"repository"` Pusher GHPusher `json:"pusher"` Sender GHSender `json:"sender"` }
GHPushEvent represents a Push of changes either new branch or a merge etc https://developer.github.com/v3/activity/events/types/#pushevent
type GHRepository ¶
type GHRepository struct { Name string `json:"name"` FullName string `json:"full_name"` URL string `json:"html_url"` Created bool `json:"created"` Deleted bool `json:"deleted"` Forced bool `json:"forced"` BaseRef string `json:"base_ref"` }
GHRepository contains really basic info about a GitHub repository. It is contained in most webhook payloads.
type GHSender ¶
type GHSender struct { ID int `json:"id"` Login string `json:"login"` AvatarURL string `json:"avatar_url"` URL string `json:"html_url"` Type string `json:"type"` }
GHSender contains more details about the person that triggered the push
type ManualTrigger ¶
ManualTrigger this is the POST payload expected when a manual trigger happens from the admin panel.