orchestrator

package
v1.356.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 19 Imported by: 6

Documentation

Index

Constants

View Source
const (
	BuildStatusSuccess    = "SUCCESS"
	BuildStatusAborted    = "ABORTED"
	BuildStatusFailure    = "FAILURE"
	BuildStatusInProgress = "IN_PROGRESS"

	BuildReasonManual          = "Manual"
	BuildReasonSchedule        = "Schedule"
	BuildReasonPullRequest     = "PullRequest"
	BuildReasonResourceTrigger = "ResourceTrigger"
	BuildReasonIndividualCI    = "IndividualCI"
	BuildReasonUnknown         = "Unknown"
)

Variables

This section is empty.

Functions

func ResetConfigProvider added in v1.333.0

func ResetConfigProvider()

ResetConfigProvider is intended to be used only for unit tests because some of these tests run with different environment variables (for example, mock runs in various orchestrators). Usage in production code is not recommended.

Types

type ChangeSet added in v1.230.0

type ChangeSet struct {
	CommitId  string
	Timestamp string
	PrNumber  int
}

type ConfigProvider added in v1.333.0

type ConfigProvider interface {
	Configure(opts *Options) error
	OrchestratorType() string
	OrchestratorVersion() string
	StageName() string
	Branch() string
	GitReference() string
	RepoURL() string
	BuildURL() string
	BuildID() string
	BuildStatus() string
	BuildReason() string
	JobURL() string
	JobName() string
	CommitSHA() string
	PullRequestConfig() PullRequestConfig
	IsPullRequest() bool
	FullLogs() ([]byte, error)
	PipelineStartTime() time.Time
	ChangeSets() []ChangeSet
}

func GetOrchestratorConfigProvider added in v1.333.0

func GetOrchestratorConfigProvider(opts *Options) (ConfigProvider, error)

type Options added in v1.333.0

type Options struct {
	JenkinsUser  string
	JenkinsToken string
	AzureToken   string
	GitHubToken  string
}

Options used to set orchestrator specific settings.

type Orchestrator

type Orchestrator int
const (
	Unknown Orchestrator = iota
	AzureDevOps
	GitHubActions
	Jenkins
)

func DetectOrchestrator

func DetectOrchestrator() Orchestrator

DetectOrchestrator function determines in which orchestrator Piper is running by examining environment variables.

func (Orchestrator) String

func (o Orchestrator) String() string

type PullRequestConfig

type PullRequestConfig struct {
	Branch string
	Base   string
	Key    string
}

type UnknownOrchestratorConfigProvider added in v1.180.0

type UnknownOrchestratorConfigProvider struct{}

func (*UnknownOrchestratorConfigProvider) Branch added in v1.333.0

func (*UnknownOrchestratorConfigProvider) BuildID added in v1.333.0

func (*UnknownOrchestratorConfigProvider) BuildReason added in v1.333.0

func (u *UnknownOrchestratorConfigProvider) BuildReason() string

func (*UnknownOrchestratorConfigProvider) BuildStatus added in v1.333.0

func (u *UnknownOrchestratorConfigProvider) BuildStatus() string

func (*UnknownOrchestratorConfigProvider) BuildURL added in v1.333.0

func (*UnknownOrchestratorConfigProvider) ChangeSets added in v1.333.0

func (u *UnknownOrchestratorConfigProvider) ChangeSets() []ChangeSet

func (*UnknownOrchestratorConfigProvider) CommitSHA added in v1.333.0

func (*UnknownOrchestratorConfigProvider) Configure added in v1.333.0

func (*UnknownOrchestratorConfigProvider) FullLogs added in v1.333.0

func (u *UnknownOrchestratorConfigProvider) FullLogs() ([]byte, error)

func (*UnknownOrchestratorConfigProvider) GitReference added in v1.333.0

func (u *UnknownOrchestratorConfigProvider) GitReference() string

func (*UnknownOrchestratorConfigProvider) IsPullRequest added in v1.180.0

func (u *UnknownOrchestratorConfigProvider) IsPullRequest() bool

func (*UnknownOrchestratorConfigProvider) JobName added in v1.333.0

func (*UnknownOrchestratorConfigProvider) JobURL added in v1.333.0

func (*UnknownOrchestratorConfigProvider) OrchestratorType added in v1.180.0

func (u *UnknownOrchestratorConfigProvider) OrchestratorType() string

func (*UnknownOrchestratorConfigProvider) OrchestratorVersion added in v1.180.0

func (u *UnknownOrchestratorConfigProvider) OrchestratorVersion() string

func (*UnknownOrchestratorConfigProvider) PipelineStartTime added in v1.333.0

func (u *UnknownOrchestratorConfigProvider) PipelineStartTime() time.Time

func (*UnknownOrchestratorConfigProvider) PullRequestConfig added in v1.333.0

func (*UnknownOrchestratorConfigProvider) RepoURL added in v1.333.0

func (*UnknownOrchestratorConfigProvider) StageName added in v1.333.0

Jump to

Keyboard shortcuts

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