v1alpha1

package
v0.13.0 Latest Latest
Warning

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

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

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the ci v1alpha1 API group +kubebuilder:object:generate=true +groupName=ci.w6d.io

Index

Constants

View Source
const (

	// DockerConfig is the key in map for the docker config.json
	DockerConfig SecretKind = ".dockerconfigjson"

	// KubeConfig is the key in map for the kubeconfig
	KubeConfig SecretKind = "kubeconfig"

	// GitToken is the key in map for the git token
	GitToken SecretKind = "git_token"

	// E2ETests is the task type for unit tests"
	E2ETests TaskType = "e2e-tests"

	// UnitTests is the task type for unit tests"
	UnitTests TaskType = "unit-tests"

	// Build is the task type for build"
	Build TaskType = "build"

	// IntegrationTests is the task type for integration tests"
	IntegrationTests TaskType = "integration-tests"

	// Deploy is the task type for deploy"
	Deploy TaskType = "deploy"

	// Clean is the task type for clean"
	Clean TaskType = "clean"

	// Creating means that tekton resource creation is in progress
	Creating State = "Creating"

	// Queued means that the PipelineRun not applied yet due to limitation
	Queued State = "Queued"

	// Running means at least on Step of the Task is running
	Running State = "Running"

	// Failed means at least on Step of the Task is failed
	Failed State = "Failed"

	// Succeeded means that all Task is success
	Succeeded State = "Succeeded"

	// Cancelled means that a TaskRun or PipelineRun has been cancelled
	Cancelled State = "Cancelled"

	// Errored means that at least one tekton resource couldn't be created
	Errored State = "Errored"

	AnnotationOrder    string = "ci.w6d.io/order"
	AnnotationTask     string = "ci.w6d.io/task"
	AnnotationKind     string = "ci.w6d.io/kind"
	AnnotationLanguage string = "ci.w6d.io/language"
	AnnotationPackage  string = "ci.w6d.io/package"

	ResourceGit   string = "source"
	ResourceImage string = "builddocker"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "ci.w6d.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var (
	SecretKinds = []SecretKind{
		DockerConfig,
		KubeConfig,
		GitToken,
	}
)

Functions

func CheckDockerTag added in v0.9.3

func CheckDockerTag(tag string) bool

CheckDockerTag is for checking the tag of the docker image

func ParseHostURL added in v0.9.3

func ParseHostURL(host string) (*url.URL, error)

ParseHostURL parses a url string, validates the string is a host url, and returns the parsed URL

Types

type Commit

type Commit struct {
	// SHA contains git commit SHA
	SHA string `json:"sha,omitempty"`

	// BeforeSHA contains the commit before sha
	// +optional
	BeforeSHA string `json:"before_sha,omitempty"`

	// Ref contains git commit reference
	Ref string `json:"ref,omitempty"`

	// Message contains commit message
	// +optional
	Message string `json:"message,omitempty"`
}

Commit contains all git information

func (*Commit) DeepCopy

func (in *Commit) DeepCopy() *Commit

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Commit.

func (*Commit) DeepCopyInto

func (in *Commit) DeepCopyInto(out *Commit)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Docker

type Docker struct {

	// Filepath contains the dockerfile full path
	// +optional
	Filepath string `json:"filepath,omitempty"`
	// Context contains the docker build context
	// +optional
	Context string `json:"context,omitempty"`
}

Docker structure contains information for docker build

func (*Docker) DeepCopy

func (in *Docker) DeepCopy() *Docker

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Docker.

func (*Docker) DeepCopyInto

func (in *Docker) DeepCopyInto(out *Docker)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LimitCi

type LimitCi struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   LimitCiSpec   `json:"spec,omitempty"`
	Status LimitCiStatus `json:"status,omitempty"`
}

LimitCi is the Schema for the limitcis API

func (*LimitCi) DeepCopy

func (in *LimitCi) DeepCopy() *LimitCi

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LimitCi.

func (*LimitCi) DeepCopyInto

func (in *LimitCi) DeepCopyInto(out *LimitCi)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LimitCi) DeepCopyObject

func (in *LimitCi) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LimitCiList

type LimitCiList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []LimitCi `json:"items"`
}

LimitCiList contains a list of LimitCi

func (*LimitCiList) DeepCopy

func (in *LimitCiList) DeepCopy() *LimitCiList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LimitCiList.

func (*LimitCiList) DeepCopyInto

func (in *LimitCiList) DeepCopyInto(out *LimitCiList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*LimitCiList) DeepCopyObject

func (in *LimitCiList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type LimitCiSpec

type LimitCiSpec struct {

	// Concurrent contains the number of pipeline running in concurrency
	Concurrent int64 `json:"concurrent,omitempty"`
}

LimitCiSpec defines the desired state of LimitCi

func (*LimitCiSpec) DeepCopy

func (in *LimitCiSpec) DeepCopy() *LimitCiSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LimitCiSpec.

func (*LimitCiSpec) DeepCopyInto

func (in *LimitCiSpec) DeepCopyInto(out *LimitCiSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LimitCiStatus

type LimitCiStatus struct {
}

LimitCiStatus defines the observed state of LimitCi

func (*LimitCiStatus) DeepCopy

func (in *LimitCiStatus) DeepCopy() *LimitCiStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LimitCiStatus.

func (*LimitCiStatus) DeepCopyInto

func (in *LimitCiStatus) DeepCopyInto(out *LimitCiStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ParamSpec added in v0.10.0

type ParamSpec struct {
	tkn.ParamSpec `json:",inline"`

	Value string `json:"value,omitempty"`
}

ParamSpec defines arbitrary parameters needed beyond typed inputs (such as resources). Parameter values are provided by users as inputs on a TaskRun or PipelineRun. It contains also the values template of the params

func (*ParamSpec) DeepCopy added in v0.10.0

func (in *ParamSpec) DeepCopy() *ParamSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ParamSpec.

func (*ParamSpec) DeepCopyInto added in v0.10.0

func (in *ParamSpec) DeepCopyInto(out *ParamSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Play

type Play struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   PlaySpec   `json:"spec,omitempty"`
	Status PlayStatus `json:"status,omitempty"`
}

Play is the Schema for the plays API

func (*Play) DeepCopy

func (in *Play) DeepCopy() *Play

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Play.

func (*Play) DeepCopyInto

func (in *Play) DeepCopyInto(out *Play)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Play) DeepCopyObject

func (in *Play) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Play) Default

func (in *Play) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*Play) Get added in v0.10.0

func (in *Play) Get(key string) string

func (*Play) GetDockerImageTagRaw added in v0.9.3

func (in *Play) GetDockerImageTagRaw() (address string, uri string, tag string, err error)

GetDockerImageTagRaw return the Docker repository

func (*Play) IsDoDeploy added in v0.11.3

func (in *Play) IsDoDeploy() bool

func (*Play) SetupWebhookWithManager

func (in *Play) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*Play) ValidateCreate

func (in *Play) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*Play) ValidateDelete

func (in *Play) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*Play) ValidateUpdate

func (in *Play) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type PlayList

type PlayList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Play `json:"items"`
}

PlayList contains a list of Play

func (*PlayList) DeepCopy

func (in *PlayList) DeepCopy() *PlayList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlayList.

func (*PlayList) DeepCopyInto

func (in *PlayList) DeepCopyInto(out *PlayList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PlayList) DeepCopyObject

func (in *PlayList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PlaySpec

type PlaySpec struct {
	// Name of project
	Name string `json:"name,omitempty"`

	// Stack of the project
	// +optional
	Stack Stack `json:"stack,omitempty"`

	// Scope contains the name of scope and list of projects id
	// +optional
	Scope Scope `json:"scope,omitempty"`

	// Environment contains application environment
	Environment string `json:"environment,omitempty"`

	// ProjectID contains the project ID
	ProjectID int64 `json:"project_id,omitempty"`

	// PipelineID contains the ID of pipeline for the project
	PipelineID int64 `json:"pipeline_id,omitempty"`

	// RepoURL contains the git repository url
	RepoURL string `json:"repo_url,omitempty"`

	// Commit contains all git information
	Commit Commit `json:"commit,omitempty"`

	// Domain contains the url for exposition
	// +optional
	Domain string `json:"domain,omitempty"`

	// Expose toggles the creation of the ingress in case of deployment
	// +optional
	Expose bool `json:"expose,omitempty"`

	// External toggles is for using in values templating
	// +optional
	External bool `json:"external,omitempty"`

	// Tasks contains the list of task to be created by Play
	Tasks []map[TaskType]Task `json:"tasks,omitempty"`

	// DockerURL contains the registry name and tag where to push docker image
	// +optional
	DockerURL string `json:"docker_url,omitempty"`

	// Secret contains the secret data. Each key must be either
	// - git_token
	// - .dockerconfigjson
	// - sonar_token
	// - kubeconfig
	// +optional
	Secret map[SecretKind]string `json:"secret,omitempty"`

	// Vault contain a vault information to get secret from
	// +optional
	Vault *Vault `json:"vault,omitempty"`
}

PlaySpec defines the desired state of Play

func (*PlaySpec) DeepCopy

func (in *PlaySpec) DeepCopy() *PlaySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlaySpec.

func (*PlaySpec) DeepCopyInto

func (in *PlaySpec) DeepCopyInto(out *PlaySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PlayStatus

type PlayStatus struct {
	// PipelineRunName contains the pipeline run name created by play
	// +optional
	PipelineRunName string `json:"pipeline_run_name,omitempty"`

	// State contains the current state of this Play resource.
	// States Running, Failed, Succeeded, Errored
	// +optional
	State State `json:"state,omitempty"`

	// Message contains the pipeline message
	// +optional
	Message string `json:"message,omitempty"`

	// Conditions represents the latest available observations of play
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

PlayStatus defines the observed state of Play

func (*PlayStatus) DeepCopy

func (in *PlayStatus) DeepCopy() *PlayStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlayStatus.

func (*PlayStatus) DeepCopyInto

func (in *PlayStatus) DeepCopyInto(out *PlayStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Scope

type Scope struct {
	// Name of the scope
	Name string `json:"name,omitempty"`

	// Projects is the list of project id in this scope
	// +optional
	Projects int64 `json:"projects,omitempty"`
}

Scope is use for gathering project

func (*Scope) DeepCopy

func (in *Scope) DeepCopy() *Scope

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Scope.

func (*Scope) DeepCopyInto

func (in *Scope) DeepCopyInto(out *Scope)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Script

type Script []string

Script type

func (Script) DeepCopy

func (in Script) DeepCopy() Script

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Script.

func (Script) DeepCopyInto

func (in Script) DeepCopyInto(out *Script)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SecretKind added in v0.8.0

type SecretKind string

SecretKind is kinds handle by the secret feature

type Stack

type Stack struct {
	// Language contains the repository language
	Language string `json:"language,omitempty"`

	// Package contains the package use in application
	// +optional
	Package string `json:"package,omitempty"`
}

Stack contains the language and package of the source

func (*Stack) DeepCopy

func (in *Stack) DeepCopy() *Stack

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Stack.

func (*Stack) DeepCopyInto

func (in *Stack) DeepCopyInto(out *Stack)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Stack) String

func (in Stack) String() string

type State

type State string

State type

type Step

type Step struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Params declares parameters passed to this task.
	// +optional
	Params []ParamSpec `json:"params,omitempty"`

	// Sidecar container
	Sidecar []tkn.Sidecar `json:"sidecar,omitempty"`
	Step    StepSpec      `json:"step,omitempty"`
	Status  StepStatus    `json:"status,omitempty"`
}

Step is the Schema for the steps API

func (*Step) DeepCopy

func (in *Step) DeepCopy() *Step

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Step.

func (*Step) DeepCopyInto

func (in *Step) DeepCopyInto(out *Step)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Step) DeepCopyObject

func (in *Step) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type StepList

type StepList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           Steps `json:"items"`
}

StepList contains a list of Step

func (*StepList) DeepCopy

func (in *StepList) DeepCopy() *StepList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepList.

func (*StepList) DeepCopyInto

func (in *StepList) DeepCopyInto(out *StepList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StepList) DeepCopyObject

func (in *StepList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type StepSpec

type StepSpec struct {
	tkn.Step `json:",inline"`
}

StepSpec defines the desired state of Step

func (*StepSpec) DeepCopy

func (in *StepSpec) DeepCopy() *StepSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepSpec.

func (*StepSpec) DeepCopyInto

func (in *StepSpec) DeepCopyInto(out *StepSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StepStatus

type StepStatus struct {
}

StepStatus defines the observed state of Step

func (*StepStatus) DeepCopy

func (in *StepStatus) DeepCopy() *StepStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepStatus.

func (*StepStatus) DeepCopyInto

func (in *StepStatus) DeepCopyInto(out *StepStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Steps

type Steps []Step

func (Steps) DeepCopy

func (in Steps) DeepCopy() Steps

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Steps.

func (Steps) DeepCopyInto

func (in Steps) DeepCopyInto(out *Steps)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Steps) Len

func (in Steps) Len() int

Len method for Sort

func (Steps) Less

func (in Steps) Less(i, j int) bool

Less method for Sort

func (Steps) Swap

func (in Steps) Swap(i, j int)

Swap method for Sort

type Task

type Task struct {
	// Image to use for this task
	// +optional
	Image string `json:"image,omitempty"`

	// Script is a list of command to execute in the task
	// +optional
	Script Script `json:"script,omitempty"`

	// Arguments is used for flags in task
	// +optional
	Arguments []string `json:"arguments,omitempty"`

	// Variables is the map of environment variable for the task
	// +optional
	Variables fields.Set `json:"variables,omitempty"`

	// Namespace where to deploy application. used only in deploy task
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Annotations is use for ingress annotations
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Docker contains information for docker build
	// +optional
	Docker Docker `json:"docker,omitempty"`
}

Task is what actions and/or configuration the task can be contains

func (*Task) DeepCopy

func (in *Task) DeepCopy() *Task

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Task.

func (*Task) DeepCopyInto

func (in *Task) DeepCopyInto(out *Task)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TaskType

type TaskType string

TaskType is the list of task granted +kubebuilder:validation:Enum=tests-unit;build;tests-integration;deploy;clean;sonar

func (TaskType) String

func (t TaskType) String() string

type Vault added in v0.8.0

type Vault struct {
	// Token vault
	// +optional
	Token string `json:"token,omitempty"`

	// Secrets is a map of the secret
	// +optional
	Secrets map[SecretKind]VaultSecret `json:"secrets,omitempty"`
}

func (*Vault) DeepCopy added in v0.8.0

func (in *Vault) DeepCopy() *Vault

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Vault.

func (*Vault) DeepCopyInto added in v0.8.0

func (in *Vault) DeepCopyInto(out *Vault)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VaultSecret added in v0.8.0

type VaultSecret struct {
	// VolumePath is the folder where the secret will be put
	VolumePath string `json:"volumePath,omitempty"`

	// Path is where the secret is in vault
	Path string `json:"path,omitempty"`
}

VaultSecret contains information for get and put vault secret

func (*VaultSecret) DeepCopy added in v0.8.0

func (in *VaultSecret) DeepCopy() *VaultSecret

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VaultSecret.

func (*VaultSecret) DeepCopyInto added in v0.8.0

func (in *VaultSecret) DeepCopyInto(out *VaultSecret)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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