Help us shape the future of Go! Take the 2026 Go Developer Survey

info

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	PACConfigmapName          = "pipelines-as-code"
	PACApplicationName        = "Pipelines as Code CI"
	HubURL                    = "https://api.hub.tekton.dev/v1"
	DefaultPipelineRunTimeout = 2 * time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	State
	Event interface{}

	// EventType is what coming from the provider header, i.e:
	// GitHub -> pull_request
	// GitLab -> Merge Request Hook
	// Incoming Webhook  -> incoming (always a push)
	// Usually used for payload filtering passed from trigger directly
	EventType string

	// Full request
	Request *Request

	// TriggerTarget stable field across providers, ie: on Gitlab, Github and
	// others it would be always be pull_request we can rely on to know if it's
	// a push or a pull_request
	TriggerTarget string

	// Target PipelineRun, the target PipelineRun user request. Used in incoming webhook
	TargetPipelineRun string

	BaseBranch        string // branch against where we are making the PR
	DefaultBranch     string // master/main branches to know where things like the OWNERS file is located.
	HeadBranch        string // branch from where our SHA get tested
	SHA               string
	Sender            string
	URL               string // WEB url not the git URL, which would match to the repo.spec
	SHAURL            string // pretty URL for web browsing for UIs (cli/web)
	SHATitle          string // commit title for UIs
	PullRequestNumber int    // Pull or Merge Request number

	// TODO: move forge specifics to each driver
	// Github
	Organization   string
	Repository     string
	InstallationID int64
	GHEURL         string

	// TODO: move out inside the provider
	// Bitbucket Cloud
	AccountID string

	// TODO: move out inside the provider
	// Bitbucket Server
	CloneURL string // bitbucket server has a different url for cloning the repo than normal public html url
	Provider *Provider

	// Gitlab
	SourceProjectID int
	TargetProjectID int
}

func NewEvent

func NewEvent() *Event

NewEvent returns a new Event

func (*Event) DeepCopyInto

func (r *Event) DeepCopyInto(out *Event)

DeepCopyInto deep copy runinfo in another instance

type Info

type Info struct {
	Pac  *PacOpts
	Kube KubeOpts
}

type KubeOpts

type KubeOpts struct {
	ConfigPath string
	Context    string
	Namespace  string
}

func (*KubeOpts) AddFlags

func (k *KubeOpts) AddFlags(cmd *cobra.Command)

type PacOpts

type PacOpts struct {
	LogURL                    string
	ApplicationName           string // the Application Name for example "Pipelines as Code"
	SecretAutoCreation        bool   // secret auto creation in target namespace
	WebhookType               string
	PayloadFile               string
	TektonDashboardURL        string
	HubURL                    string
	RemoteTasks               bool
	DefaultPipelineRunTimeout *time.Duration

	// bitbucket cloud specific fields
	BitbucketCloudCheckSourceIP      bool
	BitbucketCloudAdditionalSourceIP string
}

func (*PacOpts) AddFlags

func (p *PacOpts) AddFlags(cmd *cobra.Command) error

type Provider

type Provider struct {
	Token                 string
	URL                   string
	User                  string
	WebhookSecret         string
	WebhookSecretFromRepo bool
}

type ProviderConfig

type ProviderConfig struct {
	TaskStatusTMPL string
	APIURL         string
	Name           string
}

type Request

type Request struct {
	Header  http.Header
	Payload []byte
}

type State

type State struct {
	TargetTestPipelineRun string // PipelineRun name to run
}

Jump to

Keyboard shortcuts

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