utils

package
v0.0.0-...-8907509 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PipelineNamespaceSuffix    = "-pipeline"
	JenkinsName                = "jenkins"
	PipelineName               = "pipeline"
	PipelineSecretName         = "pipeline-secret"
	PipelineSecretUserKey      = "admin-user"
	PipelineSecretTokenKey     = "admin-token"
	PipelineSecretDefaultUser  = "admin"
	PipelineSecretDefaultToken = "admin123"
	RegistryName               = "docker-registry"
	MinioName                  = "minio"
	MinioBucketLocation        = "local"
	MinioLogBucket             = "pipeline-logs"
	NetWorkPolicyName          = "pipeline-np"
	LabelKeyApp                = "app"
	LabelKeyJenkins            = "jenkins"
	JenkinsMaster              = "master"
	LabelKeyExecution          = "execution"
	DefaultRegistry            = "index.docker.io"
	LocalRegistry              = "docker-registry:5000"
	DefaultTag                 = "latest"
	JenkinsPort                = 8080
	JenkinsJNLPPort            = 50000
	RegistryPort               = 5000
	MinioPort                  = 9000

	WebhookEventPush        = "push"
	WebhookEventPullRequest = "pull_request"
	WebhookEventTag         = "tag"

	TriggerTypeUser    = "user"
	TriggerTypeWebhook = "webhook"

	StateWaiting  = "Waiting"
	StateBuilding = "Building"
	StateSuccess  = "Success"
	StateFailed   = "Failed"
	StateSkipped  = "Skipped"
	StateAborted  = "Aborted"
	StateQueueing = "Queueing"
	StatePending  = "Pending"
	StateDenied   = "Denied"

	PipelineFinishLabel = "pipeline.management.cattle.io/finish"

	PipelineFileYml  = ".rancher-pipeline.yml"
	PipelineFileYaml = ".rancher-pipeline.yaml"

	EnvGitRepoName       = "CICD_GIT_REPO_NAME"
	EnvGitURL            = "CICD_GIT_URL"
	EnvGitCommit         = "CICD_GIT_COMMIT"
	EnvGitRef            = "CICD_GIT_REF"
	EnvGitBranch         = "CICD_GIT_BRANCH"
	EnvGitTag            = "CICD_GIT_TAG"
	EnvTriggerType       = "CICD_TRIGGER_TYPE"
	EnvEvent             = "CICD_EVENT"
	EnvExecutionID       = "CICD_EXECUTION_ID"
	EnvExecutionSequence = "CICD_EXECUTION_SEQUENCE"
	EnvPipelineID        = "CICD_PIPELINE_ID"
	EnvProjectID         = "CICD_PROJECT_ID"
	EnvClusterID         = "CICD_CLUSTER_ID"
	EnvRegistry          = "CICD_REGISTRY"
	EnvImageRepo         = "CICD_IMAGE_REPO"
	EnvLocalRegistry     = "CICD_LOCAL_REGISTRY"

	SettingExecutorQuota        = "executor-quota"
	SettingExecutorQuotaDefault = "2"

	DefaultTimeout = 60
)
View Source
const (
	PipelineByProjectIndex                    = "pipeline.project.cattle.io/pipeline-by-project"
	PipelineExecutionByClusterIndex           = "pipeline.project.cattle.io/execution-by-cluster"
	PipelineExecutionByProjectIndex           = "pipeline.project.cattle.io/execution-by-project"
	SourceCodeCredentialByProjectAndTypeIndex = "pipeline.project.cattle.io/credential-by-project-and-type"
	SourceCodeRepositoryByCredentialIndex     = "pipeline.project.cattle.io/repository-by-credential"
	SourceCodeRepositoryByProjectAndTypeIndex = "pipeline.project.cattle.io/repository-by-project-and-type"
)

Variables

This section is empty.

Functions

func Excludes

func Excludes(c *v3.Constraint, v string) bool

Excludes returns true if the string matches the exclude patterns.

func GenerateExecution

func GenerateExecution(executions v3.PipelineExecutionInterface, pipeline *v3.Pipeline, pipelineConfig *v3.PipelineConfig, info *model.BuildInfo) (*v3.PipelineExecution, error)

func GetEnvVarMap

func GetEnvVarMap(execution *v3.PipelineExecution) map[string]string

func GetNextExecutionName

func GetNextExecutionName(p *v3.Pipeline) string

func GetPipelineCommonName

func GetPipelineCommonName(obj *v3.PipelineExecution) string

func Includes

func Includes(c *v3.Constraint, v string) bool

Includes returns true if the string matches the include patterns.

func IsFinishState

func IsFinishState(state string) bool

func IsStageSuccess

func IsStageSuccess(stage v3.StageStatus) bool

func Match

func Match(c *v3.Constraint, v string) bool

func MatchAll

func MatchAll(cs *v3.Constraints, execution *v3.PipelineExecution) bool

func PipelineByProjectName

func PipelineByProjectName(obj interface{}) ([]string, error)

func PipelineConfigFromYaml

func PipelineConfigFromYaml(content []byte) (*v3.PipelineConfig, error)

func PipelineConfigToYaml

func PipelineConfigToYaml(pipelineConfig *v3.PipelineConfig) ([]byte, error)

func PipelineExecutionByClusterName

func PipelineExecutionByClusterName(obj interface{}) ([]string, error)

func PipelineExecutionByProjectName

func PipelineExecutionByProjectName(obj interface{}) ([]string, error)

func ProjectNameAndSourceCodeTypeKey

func ProjectNameAndSourceCodeTypeKey(projectName, souceCodeType string) string

func SourceCodeCredentialByProjectNameAndType

func SourceCodeCredentialByProjectNameAndType(obj interface{}) ([]string, error)

func SourceCodeRepositoryByCredentialName

func SourceCodeRepositoryByCredentialName(obj interface{}) ([]string, error)

func SourceCodeRepositoryByProjectNameAndType

func SourceCodeRepositoryByProjectNameAndType(obj interface{}) ([]string, error)

func SplitImageTag

func SplitImageTag(image string) (string, string, string)

func ValidPipelineConfig

func ValidPipelineConfig(config v3.PipelineConfig) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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