github.com/jenkins-x/jx/v2@v2.1.155/pkg/tekton/metapipeline/client.go (about) 1 package metapipeline 2 3 import ( 4 "github.com/jenkins-x/jx/v2/pkg/kube" 5 "github.com/jenkins-x/jx/v2/pkg/tekton" 6 ) 7 8 // PipelineCreateParam wraps all parameters needed for creating the meta pipeline CRDs. 9 type PipelineCreateParam struct { 10 // PullRef contains the information about the source repo as well as which state (commit) needs to be checked out. 11 // This parameter is required. 12 PullRef PullRef 13 14 // PipelineKind defines the type of the pipeline - release, feature, pull request. This parameter is required. 15 PipelineKind PipelineKind 16 17 // The build context, aka which jenkins-x.yml should be executed. The default is the empty string. 18 Context string 19 20 // EnvVariables defines a set of environment variables to be set on each container/step of the meta as well as the 21 // build pipeline. 22 EnvVariables map[string]string 23 24 // Labels defines a set of labels to be applied to the generated CRDs. 25 Labels map[string]string 26 27 // ServiceAccount defines the service account under which to execute the pipeline. 28 ServiceAccount string 29 30 // DefaultImage defines the default image used for pipeline tasks if no other image is specified. 31 // This parameter is optional and mainly used for development. 32 DefaultImage string 33 34 // UseActivityForNextBuildNumber overrides the default behavior of getting the next build number via SourceRepository, 35 // and instead determines the next build number based on existing PipelineActivitys. 36 UseActivityForNextBuildNumber bool 37 38 // UseBranchAsRevision forces step_create_task to use the branch it's passed as the revision to checkout for release 39 // pipelines, rather than use the version tag 40 UseBranchAsRevision bool 41 42 // NoReleasePrepare do not prepare the release, this passes the --no-release-prepare flag to `jx step create task` 43 NoReleasePrepare bool 44 } 45 46 // Client defines the interface for meta pipeline creation and application. 47 type Client interface { 48 // Create creates the Tekton CRDs needed for executing the pipeline as defined by the input parameters. 49 Create(param PipelineCreateParam) (kube.PromoteStepActivityKey, tekton.CRDWrapper, error) 50 51 // Apply takes the given CRDs for processing, usually applying them to the cluster. 52 Apply(pipelineActivity kube.PromoteStepActivityKey, crds tekton.CRDWrapper) error 53 54 // Close cleans up the resources use by this client. 55 Close() error 56 }