constants

package
v0.23.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 0 Imported by: 69

Documentation

Overview

Package constants provides the defined constant types for Vela.

Usage:

import "github.com/go-vela/types/constants"

Index

Constants

View Source
const (
	// ActionOpened defines the action for opening pull requests.
	ActionOpened = "opened"

	// ActionCreated defines the action for creating issue comments.
	ActionCreated = "created"

	// ActionEdited defines the action for the editing of pull requests or issue comments.
	ActionEdited = "edited"

	// ActionRenamed defines the action for renaming a repository.
	ActionRenamed = "renamed"

	// ActionReopened defines the action for re-opening a pull request (or issue).
	ActionReopened = "reopened"

	// ActionSynchronize defines the action for the synchronizing of pull requests.
	ActionSynchronize = "synchronize"

	// ActionTransferred defines the action for transferring repository ownership.
	ActionTransferred = "transferred"

	// ActionBranch defines the action for deleting a branch.
	ActionBranch = "branch"

	// ActionTag defines the action for deleting a tag.
	ActionTag = "tag"

	// ActionRun defines the action for running a schedule.
	ActionRun = "run"
)

Build and repo events.

View Source
const (
	AllowPushBranch = 1 << iota // 00000001 = 1
	AllowPushTag                // 00000010 = 2
	AllowPullOpen               // 00000100 = 4
	AllowPullEdit               // ...
	AllowPullSync

	AllowPullReopen

	AllowDeployCreate
	AllowCommentCreate
	AllowCommentEdit
	AllowSchedule
	AllowPushDeleteBranch
	AllowPushDeleteTag
)

Allowed repo events. NOTE: these can NOT change order. New events must be added at the end.

View Source
const (
	// Badge for unknown state
	// <svg xmlns="http://www.w3.org/2000/svg" width="92" height="20">
	//     <linearGradient id="b" x2="0" y2="100%">
	//         <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
	//         <stop offset="1" stop-opacity=".1"/>
	//     </linearGradient>
	//     <path d="M0 3 a3 3 0 014-3h28v20H3 a3 3 0 01-3-3V3z" fill="#555555"/>
	//     <path d="M92 17 a3 3 0 01-3 3H32V0h56 a3 3 0 014 3v12z" fill="#9f9f9f"/>
	//     <rect width="100%" height="100%" rx="3" fill="url(#b)"/>
	//     <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
	//         <text x="16" y="14" fill="#010101" fill-opacity=".3" textLength="24" lengthAdjust="spacing">vela</text>
	//         <text x="16" y="13" textLength="24" lengthAdjust="spacing">vela</text>
	//         <text x="62" y="14" fill="#010101" fill-opacity=".3" textLength="52" lengthAdjust="spacing">unknown</text>
	//         <text x="62" y="13" textLength="52" lengthAdjust="spacing">unknown</text>
	//     </g>
	// </svg>
	BadgeUnknown = `` /* 872-byte string literal not displayed */

	// Badge for success state
	// <svg xmlns="http://www.w3.org/2000/svg" width="85" height="20">
	//     <linearGradient id="a" x2="0" y2="100%">
	//         <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
	//         <stop offset="1" stop-opacity=".1"/>
	//     </linearGradient>
	//     <path d="M0 3 a3 3 0 014-3h30v20H3 a3 3 0 01-3-3V3z" fill="#555555"/>
	//     <path d="M85 17 a3 3 0 01-3 3H32V0h49 a3 3 0 014 3v12z" fill="#44cc11"/>
	//     <rect width="100%" height="100%" rx="3" fill="url(#a)"/>
	//     <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
	//         <text x="16" y="14" fill="#010101" fill-opacity=".3" textLength="24" lengthAdjust="spacing">vela</text>
	//         <text x="16" y="13" textlength="24" lengthadjust="spacing">vela</text>
	//         <text x="58" y="14" fill="#010101" fill-opacity=".3" textlength="46" lengthadjust="spacing">success</text>
	//         <text x="58" y="13" textlength="46" lengthadjust="spacing">success</text>
	//     </g>
	// </svg>
	BadgeSuccess = `` /* 872-byte string literal not displayed */

	// Badge for failed state
	// <svg xmlns="http://www.w3.org/2000/svg" width="73" height="20">
	//     <linearGradient id="a" x2="0" y2="100%">
	//         <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
	//         <stop offset="1" stop-opacity=".1"/>
	//     </linearGradient>
	//     <path d="M0 3 a3 3 0 014-3h30v20H3 a3 3 0 01-3-3V3z" fill="#555555"/>
	//     <path d="M73 17 a3 3 0 01-3 3H32V0h37 a3 3 0 014 3v12z" fill="#fe7d37"/>
	//     <rect width="100%" height="100%" rx="3" fill="url(#a)"/>
	//     <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
	//         <text x="16" y="14" fill="#010101" fill-opacity=".3" textLength="24" lengthAdjust="spacing">vela</text>
	//         <text x="16" y="13" textlength="24" lengthadjust="spacing">vela</text>
	//         <text x="52" y="14" fill="#010101" fill-opacity=".3" textlength="46" lengthadjust="spacing">failed</text>
	//         <text x="52" y="13" textlength="46" lengthadjust="spacing">failed</text>
	//     </g>
	// </svg>
	BadgeFailed = `` /* 870-byte string literal not displayed */

	// Badge for error state
	// <svg xmlns="http://www.w3.org/2000/svg" width="69" height="20">
	//     <linearGradient id="a" x2="0" y2="100%">
	//         <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
	//         <stop offset="1" stop-opacity=".1"/>
	//     </linearGradient>
	//     <path d="M0 3 a3 3 0 014-3h30v20H3 a3 3 0 01-3-3V3z" fill="#555555"/>
	//     <path d="M69 17 a3 3 0 01-3 3H32V0h33 a3 3 0 014 3v12z" fill="#e05d44"/>
	//     <rect width="100%" height="100%" rx="3" fill="url(#a)"/>
	//     <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
	//         <text x="16" y="14" fill="#010101" fill-opacity=".3" textLength="24" lengthAdjust="spacing">vela</text>
	//         <text x="16" y="13" textlength="24" lengthadjust="spacing">vela</text>
	//         <text x="50" y="14" fill="#010101" fill-opacity=".3" textlength="46" lengthadjust="spacing">error</text>
	//         <text x="50" y="13" textlength="46" lengthadjust="spacing">error</text>
	//     </g>
	// </svg>
	BadgeError = `` /* 868-byte string literal not displayed */

	// Badge for running status
	// <svg xmlns="http://www.w3.org/2000/svg" width="88" height="20">
	//     <linearGradient id="b" x2="0" y2="100%">
	//         <stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
	//         <stop offset="1" stop-opacity=".1"/>
	//     </linearGradient>
	//     <path d="M0 3 a3 3 0 014-3h28v20H3 a3 3 0 01-3-3V3z" fill="#555555"/>
	//     <path d="M88 17 a3 3 0 01-3 3H32V0h52 a3 3 0 014 3v12z" fill="#dfb317"/>
	//     <rect width="100%" height="100%" rx="3" fill="url(#b)"/>
	//     <g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
	//         <text x="16" y="14" fill="#010101" fill-opacity=".3" textLength="24" lengthAdjust="spacing">vela</text>
	//         <text x="16" y="13" textLength="24" lengthAdjust="spacing">vela</text>
	//         <text x="59" y="14" fill="#010101" fill-opacity=".3" textLength="46" lengthAdjust="spacing">running</text>
	//         <text x="59" y="13" textLength="46" lengthAdjust="spacing">running</text>
	//     </g>
	// </svg>
	BadgeRunning = `` /* 872-byte string literal not displayed */
)

Constants for build badges.

View Source
const (
	// The default compression level for the compress/zlib library
	// for log data stored in the database.
	CompressionNegOne = -1

	// Enables no compression for log data stored in the database.
	//
	// This produces no compression for the log data.
	CompressionZero = 0

	// Enables the best speed for log data stored in the database.
	//
	// This produces compression for the log data the fastest but
	// has a tradeoff of producing the largest amounts of data.
	CompressionOne = 1

	// Second compression level for log data stored in the database.
	CompressionTwo = 2

	// Third compression level for log data stored in the database.
	CompressionThree = 3

	// Fourth compression level for log data stored in the database.
	CompressionFour = 4

	// Enables an even balance of speed and compression for log
	// data stored in the database.
	//
	// This produces compression for the log data with an even
	// balance of speed while producing smaller amounts of data.
	CompressionFive = 5

	// Sixth compression level for log data stored in the database.
	CompressionSix = 6

	// Seventh compression level for log data stored in the database.
	CompressionSeven = 7

	// Eighth compression level for log data stored in the database.
	CompressionEight = 8

	// Enables the best compression for log data stored in the database.
	//
	// This produces compression for the log data the slowest but
	// has a tradeoff of producing the smallest amounts of data.
	CompressionNine = 9
)

Log Compression Levels.

View Source
const (
	// DriverPostgres defines the driver type when integrating with a PostgreSQL database.
	DriverPostgres = "postgres"

	// DriverSqlite defines the driver type when integrating with a SQLite database.
	DriverSqlite = "sqlite3"
)

Server database drivers.

View Source
const (
	// DriverDarwin defines the driver type when integrating with a darwin distribution.
	DriverDarwin = "darwin"

	// DriverLinux defines the driver type when integrating with a linux distribution.
	DriverLinux = "linux"

	// DriverLocal defines the driver type when integrating with a local system.
	DriverLocal = "local"

	// DriverWindows defines the driver type when integrating with a windows distribution.
	DriverWindows = "windows"
)

Worker executor drivers.

View Source
const (

	// DriverKafka defines the driver type when integrating with a Kafka queue.
	DriverKafka = "kafka"

	// DriverRedis defines the driver type when integrating with a Redis queue.
	DriverRedis = "redis"
)

Server and worker queue drivers.

View Source
const (
	// DriverDocker defines the driver type when integrating with a Docker runtime.
	DriverDocker = "docker"

	// DriverKubernetes defines the driver type when integrating with a Kubernetes runtime.
	DriverKubernetes = "kubernetes"
)

Worker runtime drivers.

View Source
const (
	// DriverNative defines the driver type when integrating with a Vela secret service.
	DriverNative = "native"

	// DriverVault defines the driver type when integrating with a Vault secret service.
	DriverVault = "vault"
)

Server and worker secret drivers.

View Source
const (
	// DriverGitHub defines the driver type when integrating with a Github source code system.
	DriverGithub = "github"

	// DriverGitLab defines the driver type when integrating with a Gitlab source code system.
	DriverGitlab = "gitlab"
)

Server source drivers.

View Source
const (
	// EventComment defines the event type for comments added to a pull request.
	EventComment = "comment"

	// EventDelete defines the event type for build and repo delete events.
	EventDelete = "delete"

	// EventDeploy defines the event type for build and repo deployment events.
	EventDeploy = "deployment"

	// EventPull defines the event type for build and repo pull_request events.
	EventPull = "pull_request"

	// EventPush defines the event type for build and repo push events.
	EventPush = "push"

	// EventRepository defines the general event type for repo management.
	EventRepository = "repository"

	// EventSchedule defines the event type for build and repo schedule events.
	EventSchedule = "schedule"

	// EventTag defines the event type for build and repo tag events.
	EventTag = "tag"

	// EventPullAlternate defines the alternate event type for build and repo pull_request events.
	EventPullAlternate = "pull"

	// EventDeployAlternate defines the alternate event type for build and repo deployment events.
	EventDeployAlternate = "deploy"
)

Build and repo events.

View Source
const (
	// BuildLimitMin defines the minimum value for repo concurrent build limit.
	BuildLimitMin = 1

	// BuildLimitMax defines the maximum value for repo concurrent build limit.
	BuildLimitMax = 30

	// BuildLimitDefault defines the default value for repo concurrent build limit.
	BuildLimitDefault = 10

	// BuildTimeoutMin defines the minimum value in minutes for repo build timeout.
	BuildTimeoutMin = 1

	// BuildTimeoutMax defines the maximum value in minutes for repo build timeout.
	BuildTimeoutMax = 90

	// BuildTimeoutDefault defines the default value in minutes for repo build timeout.
	BuildTimeoutDefault = 30

	// FavoritesMaxSize defines the maximum size in characters for user favorites.
	FavoritesMaxSize = 5000

	// RunningBuildIDsMaxSize defines the maximum size in characters for worker RunningBuildIDs.
	RunningBuildIDsMaxSize = 500

	// TopicsMaxSize defines the maximum size in characters for repo topics. Ex: GitHub has a 20-topic, 50-char limit.
	TopicsMaxSize = 1020

	// DeployBuildsMaxSize defines the maximum size in characters for deployment builds.
	DeployBuildsMaxSize = 500
)

Limits and constraints.

View Source
const (
	// MatcherFilepath defines the ruleset type for the filepath matcher.
	MatcherFilepath = "filepath"

	// MatcherRegex defines the ruleset type for the regex matcher.
	MatcherRegex = "regexp"
)

Ruleset matchers.

View Source
const (
	// OperatorAnd defines the ruleset type for the and operator.
	OperatorAnd = "and"

	// OperatorOr defines the ruleset type for the or operator.
	OperatorOr = "or"
)

Ruleset operators.

View Source
const (
	// PipelineStages defines the type for a pipeline with stages.
	PipelineStage = "stages"

	// PipelineStep defines the type for a pipeline with steps.
	PipelineStep = "steps"

	// PipelineTemplate defines the type for a pipeline as a template.
	PipelineTemplate = "template"
)

Pipeline types.

View Source
const (
	// PullAlways defines the pull policy type for
	// a service or step to always pull an image.
	PullAlways = "always"

	// PullNotPresent defines the pull policy type for
	// a service or step to only pull an image if it doesn't exist.
	PullNotPresent = "not_present"

	// PullOnStart defines the pull policy type for
	// a service or step to only pull an image before the container starts.
	PullOnStart = "on_start"

	// PullNever defines the pull policy type for
	// a service or step to never pull an image.
	PullNever = "never"
)

Service and step pull policies.

View Source
const (
	// PipelineTypeYAML defines the pipeline type for allowing users
	// in Vela to control their pipeline being compiled as yaml.
	PipelineTypeYAML = "yaml"

	// PipelineTypeGo defines the pipeline type for allowing users
	// in Vela to control their pipeline being compiled as Go templates.
	PipelineTypeGo = "go"

	// PipelineTypeStarlark defines the pipeline type for allowing users
	// in Vela to control their pipeline being compiled as Starlark templates.
	PipelineTypeStarlark = "starlark"
)

Repo get pipeline types.

View Source
const (
	// ApproveForkAlways defines the CI strategy of having a repo administrator approve
	// all builds triggered from a forked PR.
	ApproveForkAlways = "fork-always"

	// ApproveForkNoWrite defines the CI strategy of having a repo administrator approve
	// all builds triggered from a forked PR where the author does not have write access.
	ApproveForkNoWrite = "fork-no-write"

	// ApproveOnce defines the CI strategy of having a repo administrator approve
	// all builds triggered from an outside contributor if this is their first time contributing.
	ApproveOnce = "first-time"

	// ApproveNever defines the CI strategy of never having to approve CI builds from outside contributors.
	ApproveNever = "never"
)

Repo ApproveBuild types.

View Source
const (
	// SecretPullBuild defines the pull policy type for a secret.
	SecretPullBuild = "build_start"

	// SecretPullStep defines the pull policy type for a secret.
	SecretPullStep = "step_start"

	// SecretOrg defines the secret type for a secret scoped to a specific org.
	SecretOrg = "org"

	// SecretRepo defines the secret type for a secret scoped to a specific repo.
	SecretRepo = "repo"

	// SecretShared defines the secret type for a secret shared across the installation.
	SecretShared = "shared"

	// SecretMask defines the secret mask to be used in place of secret values returned to users.
	SecretMask = "[secure]"

	// SecretLogMask defines the secret mask to be used when distributing logs that contain secrets.
	SecretLogMask = "***"

	// SecretRestrictedCharacters defines the set of characters that a secret name cannot contain.
	// This matches the following characters:
	//   Equal Sign =
	//   Null Character \x00
	SecretRestrictedCharacters = "=\x00"
)

Secret types.

View Source
const (
	// StatusError defines the status type for build and step error statuses.
	StatusError = "error"

	// StatusFailure defines the status type for build and step failure statuses.
	StatusFailure = "failure"

	// StatusKilled defines the status type for build and step killed statuses.
	StatusKilled = "killed"

	// StatusCanceled defines the status type for build and step canceled statuses.
	StatusCanceled = "canceled"

	// StatusPending defines the status type for build and step pending statuses.
	StatusPending = "pending"

	// StatusPendingApproval defines the status type for a build waiting to be approved to run.
	StatusPendingApproval = "pending approval"

	// StatusRunning defines the status type for build and step running statuses.
	StatusRunning = "running"

	// StatusSuccess defines the status type for build and step success statuses.
	StatusSuccess = "success"

	// StatusSkipped defines the status type for build and step skipped statuses.
	StatusSkipped = "skipped"
)

Build and step statuses.

View Source
const (
	// TableBuild defines the table type for the database builds table.
	TableBuild = "builds"

	// TableBuildExecutable defines the table type for the database build_executables table.
	TableBuildExecutable = "build_executables"

	// TableDeployment defines the table type for the database deployments table.
	TableDeployment = "deployments"

	// TableHook defines the table type for the database hooks table.
	TableHook = "hooks"

	// TableLog defines the table type for the database logs table.
	TableLog = "logs"

	// TablePipeline defines the table type for the database pipelines table.
	TablePipeline = "pipelines"

	// TableRepo defines the table type for the database repos table.
	TableRepo = "repos"

	// TableSchedule defines the table type for the database schedules table.
	TableSchedule = "schedules"

	// TableSecret defines the table type for the database secrets table.
	TableSecret = "secrets"

	// TableService defines the table type for the database services table.
	TableService = "services"

	// TableStep defines the table type for the database steps table.
	TableStep = "steps"

	// TableUser defines the table type for the database users table.
	TableUser = "users"

	// TableWorker defines the table type for the database workers table.
	TableWorker = "workers"
)

Database tables.

View Source
const (
	// RefreshTokenName is the name associated with the refresh token.
	RefreshTokenName = "vela_refresh_token"

	// UserAccessTokenType is the name associated with the user access token type.
	UserAccessTokenType = "UserAccess"

	// UserRefreshTokenType is the name associated with the user refresh token type.
	UserRefreshTokenType = "UserRefresh"

	// WorkerAuthTokenType is the name associated with the worker authentication token type.
	WorkerAuthTokenType = "WorkerAuth"

	// WorkerRegisterTokenType is the name associated with the worker registration token type.
	WorkerRegisterTokenType = "WorkerRegister"

	// WorkerBuildTokenType is the name associated with the worker build token type.
	WorkerBuildTokenType = "WorkerBuild"

	// ServerWorkerTokenType is the name associated with the server-worker symmetric token.
	ServerWorkerTokenType = "ServerWorker"
)

Constants for tokens.

View Source
const (
	// VisibilityPublic defines the visibility type for allowing any
	// users in Vela to access their repo regardless of the access
	// defined in the source control system.
	VisibilityPublic = "public"

	// VisibilityPrivate defines the visibility type for only allowing
	// users in Vela with pre-defined access in the source control
	// system to access their repo.
	VisibilityPrivate = "private"
)

Repo visibility types.

View Source
const (
	// WorkerStatusIdle defines the status for a worker
	// where worker RunningBuildIDs.length = 0.
	WorkerStatusIdle = "idle"

	// WorkerStatusAvailable defines the status type for a worker in an available state,
	// where worker RunningBuildIDs.length > 0 and < worker BuildLimit.
	WorkerStatusAvailable = "available"

	// WorkerStatusBusy defines the status type for a worker in an unavailable state,
	// where worker BuildLimit == worker RunningBuildIDs.length.
	WorkerStatusBusy = "busy"

	// WorkerStatusError defines the status for a worker in an error state.
	WorkerStatusError = "error"
)

Worker statuses.

View Source
const (
	// WorkspaceDefault defines the default workspace path for a service or a step.
	WorkspaceDefault = "/vela/src"

	// WorkspaceMount defines the mount workspace path for a service or a step.
	WorkspaceMount = "/vela"
)

Service and Step workspace paths.

View Source
const (
	// DefaultRoute defines the default route all workers listen on.
	DefaultRoute = "vela"
)

Queue types.

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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