play

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTarget

func BuildTarget(play *ci.Play, filename string) (path string)

BuildTarget return the path with project ID, pipeline ID and filename

func CreateCI

func CreateCI(ctx context.Context, p *ci.Play, logger logr.Logger,
	r client.Client, scheme *runtime.Scheme) error

CreateCI takes a Play struct to create tekton Pipeline

Types

type CIFunc

type CIFunc func(ctx context.Context, c client.Client, logger logr.Logger) error

CIFunc is a function that implements the CIInterface

type CIInterface

type CIInterface interface {
	// Create will create tekton resource
	Create(ctx context.Context, r client.Client, logger logr.Logger) error
}

CIInterface implements the CI method to create tekton resource

type WFInterface

type WFInterface interface {
	// Add func in Creates list
	Add(ciFunc CIFunc) error

	CreateValues(*ci.Play, logr.Logger) error

	// ServiceAccount creates the serviceAccount resource use for running pipeline and handle secret
	ServiceAccount(*ci.Play, logr.Logger) error
	// Rbac creates the RoleBinding resource bind with the ServiceAccount
	Rbac(*ci.Play, logr.Logger) error
	// GitSecret create the secret resource for cloning
	GitSecret(*ci.Play, logr.Logger) error
	// DockerCredSecret creates the docker secret resource for pull and push image
	DockerCredSecret(*ci.Play, logr.Logger) error
	// MinIOSecret creates the s3cfg file in a secret resource
	MinIOSecret(*ci.Play, logr.Logger) error

	// SetGitCreate creates the git pipeline resource type
	SetGitCreate(*ci.Play, logr.Logger) error
	// SetGitCreate creates the image pipeline resource type
	SetImageCreate(*ci.Play, logr.Logger) error

	// SetTask executes the Task according the TaskType
	SetTask(context.Context, *ci.Play, logr.Logger) error

	// SetPipeline implements the pipeline Tekton resource
	SetPipeline(*ci.Play, logr.Logger) error
	// SetPipelineRun implements the pipeline run Tekton resource
	SetPipelineRun(*ci.Play, logr.Logger) error

	// Run executes all create method in the list
	Run(context.Context, client.Client, logr.Logger) error
}

WFInterface implements all Workflow methods

type WFType

type WFType struct {
	// Creates is the list of create methods
	Creates []CIFunc
	Client  client.Client
	Scheme  *runtime.Scheme
}

WFType contains all tekton resource to create

func (*WFType) Add

func (wf *WFType) Add(ciFunc CIFunc) error

Add appends the CIFunc to the run list

func (*WFType) CreateValues

func (wf *WFType) CreateValues(p *ci.Play, logger logr.Logger) error

func (*WFType) DockerCredSecret

func (wf *WFType) DockerCredSecret(p *ci.Play, logger logr.Logger) error

DockerCredSecret fills the secret structure and add the Docker credential create method in the run list

func (*WFType) GitSecret

func (wf *WFType) GitSecret(p *ci.Play, logger logr.Logger) error

GitSecret fills the secret structure and add the git create method in the run list

func (*WFType) MinIOSecret

func (wf *WFType) MinIOSecret(p *ci.Play, logger logr.Logger) error

MinIOSecret fills the secret structure to add minio create method in the run list

func (*WFType) Rbac

func (wf *WFType) Rbac(p *ci.Play, logger logr.Logger) error

func (*WFType) Run

func (wf *WFType) Run(ctx context.Context, r client.Client, log logr.Logger) error

Run executes Create methods in WFType

func (*WFType) ServiceAccount

func (wf *WFType) ServiceAccount(p *ci.Play, logger logr.Logger) error

func (*WFType) SetGitCreate

func (wf *WFType) SetGitCreate(p *ci.Play, logger logr.Logger) error

SetGitCreate adds git pipeline resource

func (*WFType) SetImageCreate

func (wf *WFType) SetImageCreate(p *ci.Play, logger logr.Logger) error

SetImageCreate adds image pipeline resource

func (*WFType) SetPipeline

func (wf *WFType) SetPipeline(p *ci.Play, logger logr.Logger) error

func (*WFType) SetPipelineRun

func (wf *WFType) SetPipelineRun(play *ci.Play, log logr.Logger) error

SetPipelineRun prepares the PipelineRun and add create method into the run list

func (*WFType) SetTask

func (wf *WFType) SetTask(ctx context.Context, p *ci.Play, logger logr.Logger) error

SetTask executes the Task according the TaskType

  • Build => create a build Tekton Task
  • Clean => create a cleaning Tekton Task
  • Deploy => create a deployment Tekton Task
  • IntTest => create a integration test Tekton Task
  • Sonar => create a sonar Tekton Task
  • UnitTests => create a unit test Tekton Task

Jump to

Keyboard shortcuts

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