pipelines

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AUDIT_APPROVED        string = "Approved"
	AUDIT_CANCEL_APPROVAL string = "CancelApproval"
)
View Source
const (
	AUDIT_LOCKED   string = "Locked"
	AUDIT_UNLOCKED string = "Unlocked"
)
View Source
const (
	AUDIT_PAUSED  string = "Paused"
	AUDIT_RESUMED string = "Resumed"
)
View Source
const (
	PipelinePrefix    = "pipeline:"
	PipelineRunPrefix = "pipelinerun:"
)

Variables

View Source
var (
	ErrReachedTerminalState = errors.New("pipeline rollout reached terminal state")
	ErrStageInProgress      = errors.New("pipeline stage still in progress")
)

Functions

func ApprovePipelineRun

func ApprovePipelineRun(ctx context.Context, name, id string, stageNum int) error

func ApprovePipelineRunUI

func ApprovePipelineRunUI(name, id string) error

func CancelApprovePipelineRun

func CancelApprovePipelineRun(ctx context.Context, name, id string, stageNum int) error

func CancelApprovePipelineRunUI

func CancelApprovePipelineRunUI(name, id string) error

func CancelPipelineRun

func CancelPipelineRun(ctx context.Context, name, id string) error

func Command

func Command() *cli.Command

func CreatePipeline

func CreatePipeline(name, repoType string) error

func DeletePipeline

func DeletePipeline(ctx context.Context, name string) error

func DeletePipelineRun

func DeletePipelineRun(ctx context.Context, name, id string) error

func GetPipelineCount

func GetPipelineCount(ctx context.Context) (uint64, error)

func GetPipelineRunCount

func GetPipelineRunCount(ctx context.Context, name string) (uint64, error)

func GetPipelineRunCountByState

func GetPipelineRunCountByState(ctx context.Context, name string) (map[string]int64, error)

func GetRepos

func GetRepos(repoType string) ([]string, error)

func GetWorkflows

func GetWorkflows(orgRepo string) ([]github.Workflow, error)

func LockPipeline

func LockPipeline(ctx context.Context, name, reason string) error

func LockPipelineUI

func LockPipelineUI(name, reason string) error

func PausePipelineRun

func PausePipelineRun(ctx context.Context, name, id, reason string) error

func PausePipelineRunUI

func PausePipelineRunUI(name, id, reason string) error

func ResumePipelineRun

func ResumePipelineRun(ctx context.Context, name, id, reason string) error

func ResumePipelineRunUI

func ResumePipelineRunUI(name, id, reason string) error

func RunPipeline

func RunPipeline(ctx context.Context, name, runId string, inputs map[string]string, templateValues map[string]string, trigger TriggerMetadata, force bool) error

func RunPipelineUI

func RunPipelineUI(name, runId string, inputs map[string]string, force bool) error

func SavePipeline

func SavePipeline(ctx context.Context, pipeline *Pipeline) error

func ShowAllPipelineRuns

func ShowAllPipelineRuns(name string, limit int64) error

func ShowAllPipelines

func ShowAllPipelines() error

func ShowPipeline

func ShowPipeline(name string) error

func ShowPipelineRun

func ShowPipelineRun(name, id string) error

func UnlockPipeline

func UnlockPipeline(ctx context.Context, name, reason string) error

func UnlockPipelineUI

func UnlockPipelineUI(name, reason string) error

func ValidateWorkflow

func ValidateWorkflow(orgRepo string, workflow github.Workflow) error

Types

type DatadogInfo

type DatadogInfo struct {
	Monitors       []string `json:"monitors"`
	Site           string   `json:"site"`
	ApiKey         string   `json:"api_key"`
	ApplicationKey string   `json:"application_key"`
	Rollback       bool     `json:"rollback"`
}

type MonitorInfo

type MonitorInfo struct {
	// Monitor workflow state
	Workflow WorkflowInfo `json:"workflow,omitempty"`
	Datadog  *DatadogInfo `json:"datadog,omitempty"`
}

type MonitorState

type MonitorState struct {
	Name                 string `json:"name"`
	OverallState         string `json:"overall_state"`
	OverallStateModified string `json:"overall_state_modified"`
}

type MonitoringController

type MonitoringController struct {
	*DatadogInfo
}

func (*MonitoringController) ExternalMonitoring

func (m *MonitoringController) ExternalMonitoring(_ []*core.ClientState) error

type Pipeline

type Pipeline struct {
	Name string `json:"name"`
	//GroupStages []GroupStage `json:"group_stages"`
	Stages []Stage `json:"stages"`
	Locked bool    `json:"locked"`
}

func GetPipeline

func GetPipeline(ctx context.Context, name string) (*Pipeline, error)

func ListPipelines

func ListPipelines(ctx context.Context) ([]*Pipeline, error)

type PipelineRun

type PipelineRun struct {
	Id           string            `json:"id"`
	PipelineName string            `json:"name"`
	Stages       []StageRun        `json:"stages"`
	State        string            `json:"state"`
	Created      time.Time         `json:"created"`
	Updated      time.Time         `json:"updated"`
	Inputs       map[string]string `json:"input"`
	Paused       bool              `json:"paused"`
	Version      string            `json:"version"`
	Trigger      TriggerMetadata   `json:"trigger_metadata"`
}

func GetPipelineRun

func GetPipelineRun(ctx context.Context, name, id string) (*PipelineRun, error)

func GetPipelineRuns

func GetPipelineRuns(ctx context.Context, name string) ([]*PipelineRun, error)

func GetPipelineRunsN

func GetPipelineRunsN(ctx context.Context, name string, limit int64) ([]*PipelineRun, error)

type Stage

type Stage struct {
	Repo     string            `json:"repo"`
	Workflow github.Workflow   `json:"workflow"`
	Approval bool              `json:"approval"`
	Monitor  MonitorInfo       `json:"monitor,omitempty"`
	Input    map[string]string `json:"input,omitempty"`
}

type StageRun

type StageRun struct {
	Name            string            `json:"name"`
	State           string            `json:"state"`
	Url             string            `json:"url"`
	RunId           string            `json:"run_id"`
	Started         time.Time         `json:"started"`
	Completed       time.Time         `json:"completed"`
	Title           string            `json:"title"`
	Reason          string            `json:"reason"`
	Input           map[string]string `json:"input"`
	Rollback        *StageRun         `json:"rollback,omitempty"`
	Metadata        StageRunMetadata  `json:"metadata,omitempty"`
	ConcurrentRunId string            `json:"concurrent"`
}

type StageRunApproval

type StageRunApproval struct {
	Name  string `json:"name,omitempty"`
	Login string `json:"login,omitempty"`
	Email string `json:"email,omitempty"`
}

type StageRunMetadata

type StageRunMetadata struct {
	Approval StageRunApproval `json:"approval,omitempty"`
}

type State

type State string
const (
	APP_NAME               = "pippy"
	SUCCESS          State = "Success"
	FAILED           State = "Failed"
	IN_PROGRESS      State = "InProgress"
	PENDING_APPROVAL State = "PendingApproval"
	PAUSED           State = "Paused"
	ROLLBACK         State = "Rollback"
	CONCURRENT_ERROR State = "ConcurrentError"
	CANCELED         State = "Canceled"
	LOCKED           State = "Locked"
)

type TriggerMetadata

type TriggerMetadata struct {
	Name   string `json:"name"`
	Login  string `json:"login"`
	Email  string `json:"email"`
	Reason string `json:"reason"`
}

type WorkflowInfo

type WorkflowInfo struct {
	Ignore   bool `json:"ignore"`
	Rollback bool `json:"rollback"`
}

Jump to

Keyboard shortcuts

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