jx: github.com/jenkins-x/jx/pkg/tekton/metapipeline Index | Files

package metapipeline

import "github.com/jenkins-x/jx/pkg/tekton/metapipeline"


Package Files

client.go clientfactory.go kind.go metapipeline.go pullref.go


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

type CRDCreationParameters Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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.

    // FeaturePipeline indicates a feature pipeline build.

func StringToPipelineKind Uses

func StringToPipelineKind(text string) PipelineKind

StringToPipelineKind converts text to a PipelineKind

func (PipelineKind) String Uses

func (p PipelineKind) String() string

String returns a string representation of the pipeline type

type PullRef Uses

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 Uses

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 Uses

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

NewPullRefWithPullRequest creates a pull ref for a pull request.

func (*PullRef) BaseBranch Uses

func (p *PullRef) BaseBranch() string

BaseBranch returns the base branch of this pull ref.

func (*PullRef) BaseSHA Uses

func (p *PullRef) BaseSHA() string

BaseSHA returns the base sha of this pull ref.

func (*PullRef) PullRequests Uses

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

PullRequests returns the pull request for this pull ref.

func (*PullRef) SourceURL Uses

func (p *PullRef) SourceURL() string

SourceURL returns the source URL of this pull ref

func (*PullRef) String Uses

func (p *PullRef) String() string

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

type PullRequestRef Uses

type PullRequestRef struct {
    ID       string
    MergeSHA string

PullRequestRef defines a pull request which needs to be merged.

Package metapipeline imports 25 packages (graph) and is imported by 4 packages. Updated 2020-07-02. Refresh now. Tools for package owners.