metapipeline

package
v2.1.155 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// MetaPipelineStageName is the name used for the single stage used within a metapipeline
	MetaPipelineStageName = "meta-pipeline"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CRDCreationParameters

type CRDCreationParameters struct {
	Namespace           string
	Context             string
	PipelineName        string
	PipelineKind        PipelineKind
	BuildNumber         string
	GitInfo             gits.GitRepository
	BranchIdentifier    string
	PullRef             PullRef
	SourceDir           string
	PodTemplates        map[string]*corev1.Pod
	ServiceAccount      string
	Labels              map[string]string
	EnvVars             map[string]string
	DefaultImage        string
	Apps                []jenkinsv1.App
	VersionsDir         string
	UseBranchAsRevision bool
	NoReleasePrepare    bool
}

CRDCreationParameters are the parameters needed to create the Tekton CRDs

type Client

type Client interface {
	// Create creates the Tekton CRDs needed for executing the pipeline as defined by the input parameters.
	Create(param PipelineCreateParam) (kube.PromoteStepActivityKey, tekton.CRDWrapper, error)

	// Apply takes the given CRDs for processing, usually applying them to the cluster.
	Apply(pipelineActivity kube.PromoteStepActivityKey, crds tekton.CRDWrapper) error

	// Close cleans up the resources use by this client.
	Close() error
}

Client defines the interface for meta pipeline creation and application.

func NewMetaPipelineClient

func NewMetaPipelineClient() (Client, error)

NewMetaPipelineClient creates a new client for the creation and application of meta pipelines. The responsibility of the meta pipeline is to prepare the execution pipeline and to allow Apps to contribute the this execution pipeline.

func NewMetaPipelineClientWithClientsAndNamespace

func NewMetaPipelineClientWithClientsAndNamespace(jxClient versioned.Interface, tektonClient tektonclient.Interface, kubeClient kubernetes.Interface, ns string) (Client, error)

NewMetaPipelineClientWithClientsAndNamespace creates a new client for the creation and application of meta pipelines using the specified parameters.

type PipelineCreateParam

type PipelineCreateParam struct {
	// PullRef contains the information about the source repo as well as which state (commit) needs to be checked out.
	// This parameter is required.
	PullRef PullRef

	// PipelineKind defines the type of the pipeline - release, feature, pull request. This parameter is required.
	PipelineKind PipelineKind

	// The build context, aka which jenkins-x.yml should be executed. The default is the empty string.
	Context string

	// EnvVariables defines a set of environment variables to be set on each container/step of the meta as well as the
	// build pipeline.
	EnvVariables map[string]string

	// Labels defines a set of labels to be applied to the generated CRDs.
	Labels map[string]string

	// ServiceAccount defines the service account under which to execute the pipeline.
	ServiceAccount string

	// DefaultImage defines the default image used for pipeline tasks if no other image is specified.
	// This parameter is optional and mainly used for development.
	DefaultImage string

	// UseActivityForNextBuildNumber overrides the default behavior of getting the next build number via SourceRepository,
	// and instead determines the next build number based on existing PipelineActivitys.
	UseActivityForNextBuildNumber bool

	// UseBranchAsRevision forces step_create_task to use the branch it's passed as the revision to checkout for release
	// pipelines, rather than use the version tag
	UseBranchAsRevision bool

	// NoReleasePrepare do not prepare the release, this passes the --no-release-prepare flag to `jx step create task`
	NoReleasePrepare bool
}

PipelineCreateParam wraps all parameters needed for creating the meta pipeline CRDs.

type PipelineKind

type PipelineKind uint32

PipelineKind defines the type of the pipeline

const (
	// ReleasePipeline indicates a release pipeline build.
	ReleasePipeline PipelineKind = iota

	// PullRequestPipeline indicates a pull request pipeline build.
	PullRequestPipeline

	// FeaturePipeline indicates a feature pipeline build.
	FeaturePipeline
)

func StringToPipelineKind

func StringToPipelineKind(text string) PipelineKind

StringToPipelineKind converts text to a PipelineKind

func (PipelineKind) String

func (p PipelineKind) String() string

String returns a string representation of the pipeline type

type PullRef

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

PullRef defines all required information for checking out the source in the required state for the pipeline execution

func NewPullRef

func NewPullRef(sourceURL string, baseBranch string, baseSHA string) PullRef

NewPullRef creates a pull ref for a master/feature build with no pull requests.

func NewPullRefWithPullRequest

func NewPullRefWithPullRequest(sourceURL string, baseBranch string, baseSHA string, prRef ...PullRequestRef) PullRef

NewPullRefWithPullRequest creates a pull ref for a pull request.

func (*PullRef) BaseBranch

func (p *PullRef) BaseBranch() string

BaseBranch returns the base branch of this pull ref.

func (*PullRef) BaseSHA

func (p *PullRef) BaseSHA() string

BaseSHA returns the base sha of this pull ref.

func (*PullRef) PullRequests

func (p *PullRef) PullRequests() []PullRequestRef

PullRequests returns the pull request for this pull ref.

func (*PullRef) SourceURL

func (p *PullRef) SourceURL() string

SourceURL returns the source URL of this pull ref

func (*PullRef) String

func (p *PullRef) String() string

String returns a string representation of this pull ref in Prow PullRef format.

type PullRequestRef

type PullRequestRef struct {
	ID       string
	MergeSHA string
}

PullRequestRef defines a pull request which needs to be merged.

Jump to

Keyboard shortcuts

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