 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package webhook contains code for managing and serving webhook services, providing post push events to trigger builds.
Index ¶
- Constants
- Variables
- func CheckSecret(namespace, userSecret string, triggers []*buildapi.WebHookTrigger, ...) (*buildapi.WebHookTrigger, error)
- func GenerateBuildTriggerInfo(revision *buildapi.SourceRevision, hookType, secret string) (buildTriggerCauses []buildapi.BuildTriggerCause)
- func GitRefMatches(eventRef, configRef string, buildSource *buildapi.BuildSource) bool
- func NewWarning(message string) *kerrors.StatusError
- type Plugin
Constants ¶
      View Source
      
  
const (
	DefaultConfigRef = "master"
)
    Variables ¶
Functions ¶
func CheckSecret ¶
func CheckSecret(namespace, userSecret string, triggers []*buildapi.WebHookTrigger, secretsClient kcoreclient.SecretsGetter) (*buildapi.WebHookTrigger, error)
CheckSecret tests the user provided secret against the secrets for the webhook triggers, if a match is found then the corresponding webhook trigger is returned.
func GenerateBuildTriggerInfo ¶
func GenerateBuildTriggerInfo(revision *buildapi.SourceRevision, hookType, secret string) (buildTriggerCauses []buildapi.BuildTriggerCause)
func GitRefMatches ¶
func GitRefMatches(eventRef, configRef string, buildSource *buildapi.BuildSource) bool
GitRefMatches determines if the ref from a webhook event matches a build configuration
func NewWarning ¶ added in v1.4.0
func NewWarning(message string) *kerrors.StatusError
NewWarning returns an StatusError object with a http.StatusOK (200) code.
Types ¶
type Plugin ¶
type Plugin interface {
	// Method extracts build information and returns:
	// - newly created build object or nil if default is to be created
	// - information whether to trigger the build itself
	// - eventual error.
	Extract(buildCfg *buildapi.BuildConfig, trigger *buildapi.WebHookTrigger, req *http.Request) (*buildapi.SourceRevision, []kapi.EnvVar, *buildapi.DockerStrategyOptions, bool, error)
	GetTriggers(buildConfig *buildapi.BuildConfig) ([]*buildapi.WebHookTrigger, error)
}
    Plugin for Webhook verification is dependent on the sending side, it can be eg. github, bitbucket or else, so there must be a separate Plugin instance for each webhook provider.
       Source Files
      ¶
      Source Files
      ¶
    
- doc.go
- webhook.go
       Directories
      ¶
      Directories
      ¶
    
    | Path | Synopsis | 
|---|---|
| Package bitbucket contains webhook.Plugin implementation of bitbucket webhooks according to https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html | Package bitbucket contains webhook.Plugin implementation of bitbucket webhooks according to https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html | 
| Package generic contains webhook.Plugin implementation of a generic webhooks for use in testing and/or other ad/hoc usage | Package generic contains webhook.Plugin implementation of a generic webhooks for use in testing and/or other ad/hoc usage | 
| Package github contains webhook.Plugin implementation of github webhooks according to https://developer.github.com/webhooks/ | Package github contains webhook.Plugin implementation of github webhooks according to https://developer.github.com/webhooks/ | 
| Package gitlab contains webhook.Plugin implementation of gitlab webhooks according to https://docs.gitlab.com/ce/user/project/integrations/webhooks.html | Package gitlab contains webhook.Plugin implementation of gitlab webhooks according to https://docs.gitlab.com/ce/user/project/integrations/webhooks.html | 
 Click to show internal directories. 
   Click to hide internal directories.