render

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PipelineTemplateName       = "pipeline-template"
	DockerCredentialsName      = "dockerconfig"
	DockerCredentialsWorkspace = "docker-credentials"
)
View Source
const BuildPushImageContent = `` /* 3172-byte string literal not displayed */
View Source
const CustomTaskTemplateContent = `` /* 1875-byte string literal not displayed */
View Source
const (
	CustomTaskTemplateName = "pipeline custom task template"
)
View Source
const GitCloneTaskContent = `` /* 9450-byte string literal not displayed */
View Source
const GoLintTaskContent = `` /* 2601-byte string literal not displayed */
View Source
const GoTestTaskContent = `` /* 2668-byte string literal not displayed */
View Source
const PipelineTemplateContent = `` /* 2062-byte string literal not displayed */
View Source
const RBACTemplateContent = `` /* 1945-byte string literal not displayed */
View Source
const (
	RBACTemplateName = "pipeline rbac template"
)
View Source
const TriggerTemplateContent = `` /* 2929-byte string literal not displayed */
View Source
const (
	TriggerTemplateName = "pipeline trigger template"
)

Variables

This section is empty.

Functions

func GeneratePipelineOwnerRef

func GeneratePipelineOwnerRef(pipeline *pipelineapi.Pipeline) *metav1.OwnerReference

func RenderCustomTask

func RenderCustomTask(cfg CustomTaskConfig) ([]byte, error)

RenderCustomTask takes a CustomTaskConfig object and generates YAML byte array configuration representing the CustomTask configuration.

func RenderCustomTaskWithPipeline

func RenderCustomTaskWithPipeline(pipeline *pipelineapi.Pipeline, taskName string, task *pipelineapi.CustomTask) ([]byte, error)

RenderCustomTaskWithPipeline takes a Pipeline object and generates YAML byte array configuration representing the CustomTask configuration.

func RenderPipelineWithPipeline

func RenderPipelineWithPipeline(pipeline *pipelineapi.Pipeline) ([]byte, error)

RenderPipelineWithPipeline renders the pipeline configuration as a YAML byte array. It uses the specified pipeline to gather necessary information.

func RenderPredefinedTask

func RenderPredefinedTask(cfg PredefinedTaskConfig) ([]byte, error)

RenderPredefinedTask takes a PredefinedTaskConfig object and generates YAML byte array configuration representing the PredefinedTask configuration.

func RenderPredefinedTaskWithPipeline

func RenderPredefinedTaskWithPipeline(pipeline *pipelineapi.Pipeline, task *pipelineapi.PredefinedTask) ([]byte, error)

RenderPredefinedTaskWithPipeline takes a Pipeline object and generates YAML byte array configuration representing the PredefinedTask configuration.

func RenderRBAC

func RenderRBAC(cfg RBACConfig) ([]byte, error)

RenderRBAC renders the RBAC configuration using a specified template.

func RenderTrigger

func RenderTrigger(cfg TriggerConfig) ([]byte, error)

RenderTrigger takes a TriggerConfig object and generates YAML byte array configuration representing the trigger configuration.

func RenderTriggerWithPipeline

func RenderTriggerWithPipeline(pipeline *pipelineapi.Pipeline) ([]byte, error)

RenderTriggerWithPipeline takes a pipeline object and generates YAML byte array configuration representing the trigger configuration.

Types

type CustomTaskConfig

type CustomTaskConfig struct {
	TaskName             string
	PipelineName         string
	PipelineNamespace    string
	Image                string
	Command              []string
	Args                 []string
	Env                  []corev1.EnvVar
	ResourceRequirements *corev1.ResourceRequirements
	Script               string
	OwnerReference       *metav1.OwnerReference
}

func (CustomTaskConfig) CustomTaskName

func (cfg CustomTaskConfig) CustomTaskName() string

CustomTaskName is the name of custom task object, in case different pipeline have the same name task.

type PipelineConfig

type PipelineConfig struct {
	PipelineName      string
	PipelineNamespace string

	// TasksInfo contains the necessary information to integrate tasks into the pipeline.
	TasksInfo      string
	OwnerReference *metav1.OwnerReference

	// DockerCredentials is the name of Docker credentials secret for image build tasks.
	DockerCredentials string
}

PipelineConfig defines the configuration needed to render a pipeline.

type PredefinedTaskConfig

type PredefinedTaskConfig struct {
	PipelineName string
	Namespace    string
	// TemplateName is set by user in `Pipeline.Tasks[i].PredefinedTask.Name`
	TemplateName string
	// Params is set by user in `Pipeline.Tasks[i].PredefinedTask.Params`
	Params         map[string]string
	OwnerReference *metav1.OwnerReference
}

func (PredefinedTaskConfig) PredefinedTaskName

func (cfg PredefinedTaskConfig) PredefinedTaskName() string

PredefinedTaskName is the name of Predefined task object, in case different pipeline have the same name task.

type RBACConfig

type RBACConfig struct {
	PipelineName         string // Name of the pipeline.
	PipelineNamespace    string // Kubernetes namespace where the pipeline is deployed.
	OwnerReference       *metav1.OwnerReference
	ChainCredentialsName string
}

RBACConfig contains the configuration data required for the RBAC template. Both PipelineName and PipelineNamespace are required.

func (RBACConfig) ServiceAccountName

func (rbac RBACConfig) ServiceAccountName() string

ServiceAccountName generates the service account name using the pipeline name.

type TaskInfo

type TaskInfo struct {
	Name       string
	TaskRef    string
	RunAfter   string
	Workspaces []Workspace
	Retries    int
}

type TriggerConfig

type TriggerConfig struct {
	PipelineName      string
	PipelineNamespace string
	OwnerReference    *metav1.OwnerReference
	AccessMode        string
	StorageRequest    string
	StorageClassName  string
	VolumeMode        string
}

func (TriggerConfig) ServiceAccountName

func (cfg TriggerConfig) ServiceAccountName() string

ServiceAccountName is the service account used by trigger

type Workspace

type Workspace struct {
	Name      string
	Workspace string
}

Jump to

Keyboard shortcuts

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