trigger

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package trigger provides a piped component that detects a list of application should be synced (by new commit, sync command or configuration drift) and then sends request to the control-plane to create a new Deployment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Determiner added in v0.10.3

type Determiner struct {
	// contains filtered or unexported fields
}

func NewDeterminer added in v0.10.3

func NewDeterminer(repo git.Repo, targetCommit string, cg LastTriggeredCommitGetter, logger *zap.Logger) *Determiner

func (*Determiner) ShouldTrigger added in v0.10.3

func (d *Determiner) ShouldTrigger(ctx context.Context, app *model.Application) (bool, error)

ShouldTrigger decides whether a given application should be triggered or not.

type LastTriggeredCommitGetter added in v0.10.3

type LastTriggeredCommitGetter interface {
	Get(ctx context.Context, applicationID string) (string, error)
}

type Trigger

type Trigger struct {
	// contains filtered or unexported fields
}

func NewTrigger

func NewTrigger(
	apiClient apiClient,
	gitClient gitClient,
	appLister applicationLister,
	commandLister commandLister,
	environmentLister environmentLister,
	notifier notifier,
	cfg *config.PipedSpec,
	gracePeriod time.Duration,
	logger *zap.Logger,
) (*Trigger, error)

NewTrigger creates a new instance for Trigger.

func (*Trigger) GetLastTriggeredCommitGetter added in v0.10.3

func (t *Trigger) GetLastTriggeredCommitGetter() LastTriggeredCommitGetter

func (*Trigger) Run

func (t *Trigger) Run(ctx context.Context) error

Run starts running Trigger until the specified context has done. This also waits for its cleaning up before returning.

Jump to

Keyboard shortcuts

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