triggerer

package
v1.0.2-gitspaces-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

WireSet provides a wire set for this package.

Functions

func Envs

func Envs(
	repo *types.Repository,
	pipeline *types.Pipeline,
	urlProvider url.Provider,
) map[string]string

Types

type Hook

type Hook struct {
	Parent       int64              `json:"parent"`
	Trigger      string             `json:"trigger"`
	TriggeredBy  int64              `json:"triggered_by"`
	Action       enum.TriggerAction `json:"action"`
	Link         string             `json:"link"`
	Timestamp    int64              `json:"timestamp"`
	Title        string             `json:"title"`
	Message      string             `json:"message"`
	Before       string             `json:"before"`
	After        string             `json:"after"`
	Ref          string             `json:"ref"`
	Fork         string             `json:"fork"`
	Source       string             `json:"source"`
	Target       string             `json:"target"`
	AuthorLogin  string             `json:"author_login"`
	AuthorName   string             `json:"author_name"`
	AuthorEmail  string             `json:"author_email"`
	AuthorAvatar string             `json:"author_avatar"`
	Debug        bool               `json:"debug"`
	Cron         string             `json:"cron"`
	Sender       string             `json:"sender"`
	Params       map[string]string  `json:"params"`
}

Hook represents the payload of a post-commit hook.

type Triggerer

type Triggerer interface {
	Trigger(ctx context.Context, pipeline *types.Pipeline, hook *Hook) (*types.Execution, error)
}

Triggerer is responsible for triggering a Execution from an incoming hook (could be manual or webhook). If an execution is skipped a nil value is returned.

func New

func New(
	executionStore store.ExecutionStore,
	checkStore store.CheckStore,
	stageStore store.StageStore,
	pipelineStore store.PipelineStore,
	tx dbtx.Transactor,
	repoStore store.RepoStore,
	urlProvider url.Provider,
	scheduler scheduler.Scheduler,
	fileService file.Service,
	converterService converter.Service,
	templateStore store.TemplateStore,
	pluginStore store.PluginStore,
	publicAccess publicaccess.Service,
) Triggerer

func ProvideTriggerer

func ProvideTriggerer(
	executionStore store.ExecutionStore,
	checkStore store.CheckStore,
	stageStore store.StageStore,
	tx dbtx.Transactor,
	pipelineStore store.PipelineStore,
	fileService file.Service,
	converterService converter.Service,
	scheduler scheduler.Scheduler,
	repoStore store.RepoStore,
	urlProvider url.Provider,
	templateStore store.TemplateStore,
	pluginStore store.PluginStore,
	publicAccess publicaccess.Service,
) Triggerer

ProvideTriggerer provides a triggerer which can execute builds.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL