atc

package
v6.7.3-0...-1f455d7 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

README ¶

atc badge

air traffic control - web ui and build scheduler

Air Traffic Control

by NATS Press Office

reporting issues and requesting features

please report all issues and feature requests in concourse/concourse

about

atc is the brain of Concourse. It's responsible for scheduling builds across the cluster of workers, providing the API for the system, as well as serving the web interface.

It can be scaled horizontally behind a load balancer in order to scale the system.

Documentation ¶

Index ¶

Constants ¶

View Source
const (
	TeamCacheName    = "teams"
	TeamCacheChannel = "team_cache"
)
View Source
const (
	ComponentScheduler                  = "scheduler"
	ComponentBuildTracker               = "tracker"
	ComponentLidarScanner               = "scanner"
	ComponentBuildReaper                = "reaper"
	ComponentSyslogDrainer              = "drainer"
	ComponentCollectorAccessTokens      = "collector_access_tokens"
	ComponentCollectorArtifacts         = "collector_artifacts"
	ComponentCollectorBuilds            = "collector_builds"
	ComponentCollectorCheckSessions     = "collector_check_sessions"
	ComponentCollectorChecks            = "collector_checks"
	ComponentCollectorContainers        = "collector_containers"
	ComponentCollectorResourceCacheUses = "collector_resource_cache_uses"
	ComponentCollectorResourceCaches    = "collector_resource_caches"
	ComponentCollectorResourceConfigs   = "collector_resource_configs"
	ComponentCollectorVolumes           = "collector_volumes"
	ComponentCollectorWorkers           = "collector_workers"
	ComponentCollectorPipelines         = "collector_pipelines"
)
View Source
const (
	ContainerStateCreated    = "created"
	ContainerStateCreating   = "creating"
	ContainerStateDestroying = "destroying"
	ContainerStateFailed     = "failed"
)
View Source
const (
	LinkRelNext     = "next"
	LinkRelPrevious = "previous"

	PaginationQueryTimestamps = "timestamps"
	PaginationQueryFrom       = "from"
	PaginationQueryTo         = "to"
	PaginationQueryLimit      = "limit"
	PaginationWebLimit        = 100
	PaginationAPIDefaultLimit = 100
)
View Source
const (
	SaveConfig = "SaveConfig"
	GetConfig  = "GetConfig"

	GetBuild            = "GetBuild"
	GetBuildPlan        = "GetBuildPlan"
	CreateBuild         = "CreateBuild"
	ListBuilds          = "ListBuilds"
	BuildEvents         = "BuildEvents"
	BuildResources      = "BuildResources"
	AbortBuild          = "AbortBuild"
	GetBuildPreparation = "GetBuildPreparation"

	GetJob         = "GetJob"
	CreateJobBuild = "CreateJobBuild"
	RerunJobBuild  = "RerunJobBuild"
	ListAllJobs    = "ListAllJobs"
	ListJobs       = "ListJobs"
	ListJobBuilds  = "ListJobBuilds"
	ListJobInputs  = "ListJobInputs"
	GetJobBuild    = "GetJobBuild"
	PauseJob       = "PauseJob"
	UnpauseJob     = "UnpauseJob"
	ScheduleJob    = "ScheduleJob"
	GetVersionsDB  = "GetVersionsDB"
	JobBadge       = "JobBadge"
	MainJobBadge   = "MainJobBadge"

	ClearTaskCache = "ClearTaskCache"

	ListAllResources     = "ListAllResources"
	ListResources        = "ListResources"
	ListResourceTypes    = "ListResourceTypes"
	GetResource          = "GetResource"
	CheckResource        = "CheckResource"
	CheckResourceWebHook = "CheckResourceWebHook"
	CheckResourceType    = "CheckResourceType"

	ListResourceVersions          = "ListResourceVersions"
	GetResourceVersion            = "GetResourceVersion"
	EnableResourceVersion         = "EnableResourceVersion"
	DisableResourceVersion        = "DisableResourceVersion"
	PinResourceVersion            = "PinResourceVersion"
	UnpinResource                 = "UnpinResource"
	SetPinCommentOnResource       = "SetPinCommentOnResource"
	ListBuildsWithVersionAsInput  = "ListBuildsWithVersionAsInput"
	ListBuildsWithVersionAsOutput = "ListBuildsWithVersionAsOutput"
	GetResourceCausality          = "GetResourceCausality"

	GetCC = "GetCC"

	ListAllPipelines    = "ListAllPipelines"
	ListPipelines       = "ListPipelines"
	GetPipeline         = "GetPipeline"
	DeletePipeline      = "DeletePipeline"
	OrderPipelines      = "OrderPipelines"
	PausePipeline       = "PausePipeline"
	ArchivePipeline     = "ArchivePipeline"
	UnpausePipeline     = "UnpausePipeline"
	ExposePipeline      = "ExposePipeline"
	HidePipeline        = "HidePipeline"
	RenamePipeline      = "RenamePipeline"
	ListPipelineBuilds  = "ListPipelineBuilds"
	CreatePipelineBuild = "CreatePipelineBuild"
	PipelineBadge       = "PipelineBadge"

	RegisterWorker  = "RegisterWorker"
	LandWorker      = "LandWorker"
	RetireWorker    = "RetireWorker"
	PruneWorker     = "PruneWorker"
	HeartbeatWorker = "HeartbeatWorker"
	ListWorkers     = "ListWorkers"
	DeleteWorker    = "DeleteWorker"

	SetLogLevel = "SetLogLevel"
	GetLogLevel = "GetLogLevel"

	DownloadCLI  = "DownloadCLI"
	GetInfo      = "GetInfo"
	GetInfoCreds = "GetInfoCreds"

	ListContainers           = "ListContainers"
	GetContainer             = "GetContainer"
	HijackContainer          = "HijackContainer"
	ListDestroyingContainers = "ListDestroyingContainers"
	ReportWorkerContainers   = "ReportWorkerContainers"

	ListVolumes           = "ListVolumes"
	ListDestroyingVolumes = "ListDestroyingVolumes"
	ReportWorkerVolumes   = "ReportWorkerVolumes"

	ListTeams      = "ListTeams"
	GetTeam        = "GetTeam"
	SetTeam        = "SetTeam"
	RenameTeam     = "RenameTeam"
	DestroyTeam    = "DestroyTeam"
	ListTeamBuilds = "ListTeamBuilds"

	CreateArtifact     = "CreateArtifact"
	GetArtifact        = "GetArtifact"
	ListBuildArtifacts = "ListBuildArtifacts"

	GetUser              = "GetUser"
	ListActiveUsersSince = "ListActiveUsersSince"

	SetWall   = "SetWall"
	GetWall   = "GetWall"
	ClearWall = "ClearWall"
)
View Source
const (
	ClearTaskCacheQueryPath = "cache_path"
	SaveConfigCheckCreds    = "check_creds"
)
View Source
const ConfigVersionHeader = "X-Concourse-Config-Version"
View Source
const DefaultTeamName = "main"
View Source
const InputsAll = "all"
View Source
const InputsDetect = "detect"
View Source
const MaxInFlightAll = "all"
View Source
const VersionEvery = "every"
View Source
const VersionLatest = "latest"

Variables ¶

View Source
var (
	EnableGlobalResources                bool
	EnableRedactSecrets                  bool
	EnableBuildRerunWhenWorkerDisappears bool
	EnableAcrossStep                     bool
	EnablePipelineInstances              bool
)
View Source
var (
	ErrAuthConfigEmpty   = errors.New("auth config for the team must not be empty")
	ErrAuthConfigInvalid = errors.New("auth config for the team does not have users and groups configured")
)
View Source
var ErrInvalidWorkerVersion = errors.New("invalid worker version, only numeric characters are allowed")
View Source
var ErrMissingWorkerGardenAddress = errors.New("missing garden address")
View Source
var ErrNoCoreStepDeclared = errors.New("no core step type declared (e.g. get, put, task, etc.)")
View Source
var ErrNoStepConfigured = errors.New("no step configured")

ErrNoStepConfigured is returned when a step does not have any keys that indicate its step type.

View Source
var ErrNoWorkers = errors.New("no workers available for checking")
View Source
var Routes = rata.Routes([]rata.Route{
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/config", Method: "PUT", Name: SaveConfig},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/config", Method: "GET", Name: GetConfig},

	{Path: "/api/v1/teams/:team_name/builds", Method: "POST", Name: CreateBuild},

	{Path: "/api/v1/builds", Method: "GET", Name: ListBuilds},
	{Path: "/api/v1/builds/:build_id", Method: "GET", Name: GetBuild},
	{Path: "/api/v1/builds/:build_id/plan", Method: "GET", Name: GetBuildPlan},
	{Path: "/api/v1/builds/:build_id/events", Method: "GET", Name: BuildEvents},
	{Path: "/api/v1/builds/:build_id/resources", Method: "GET", Name: BuildResources},
	{Path: "/api/v1/builds/:build_id/abort", Method: "PUT", Name: AbortBuild},
	{Path: "/api/v1/builds/:build_id/preparation", Method: "GET", Name: GetBuildPreparation},
	{Path: "/api/v1/builds/:build_id/artifacts", Method: "GET", Name: ListBuildArtifacts},

	{Path: "/api/v1/jobs", Method: "GET", Name: ListAllJobs},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs", Method: "GET", Name: ListJobs},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name", Method: "GET", Name: GetJob},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/builds", Method: "GET", Name: ListJobBuilds},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/builds", Method: "POST", Name: CreateJobBuild},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/builds/:build_name", Method: "POST", Name: RerunJobBuild},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/inputs", Method: "GET", Name: ListJobInputs},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/builds/:build_name", Method: "GET", Name: GetJobBuild},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/pause", Method: "PUT", Name: PauseJob},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/unpause", Method: "PUT", Name: UnpauseJob},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/schedule", Method: "PUT", Name: ScheduleJob},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/badge", Method: "GET", Name: JobBadge},
	{Path: "/api/v1/pipelines/:pipeline_name/jobs/:job_name/badge", Method: "GET", Name: MainJobBadge},

	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/jobs/:job_name/tasks/:step_name/cache", Method: "DELETE", Name: ClearTaskCache},

	{Path: "/api/v1/pipelines", Method: "GET", Name: ListAllPipelines},
	{Path: "/api/v1/teams/:team_name/pipelines", Method: "GET", Name: ListPipelines},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name", Method: "GET", Name: GetPipeline},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name", Method: "DELETE", Name: DeletePipeline},
	{Path: "/api/v1/teams/:team_name/pipelines/ordering", Method: "PUT", Name: OrderPipelines},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/pause", Method: "PUT", Name: PausePipeline},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/archive", Method: "PUT", Name: ArchivePipeline},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/unpause", Method: "PUT", Name: UnpausePipeline},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/expose", Method: "PUT", Name: ExposePipeline},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/hide", Method: "PUT", Name: HidePipeline},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/versions-db", Method: "GET", Name: GetVersionsDB},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/rename", Method: "PUT", Name: RenamePipeline},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/builds", Method: "GET", Name: ListPipelineBuilds},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/builds", Method: "POST", Name: CreatePipelineBuild},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/badge", Method: "GET", Name: PipelineBadge},

	{Path: "/api/v1/resources", Method: "GET", Name: ListAllResources},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources", Method: "GET", Name: ListResources},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resource-types", Method: "GET", Name: ListResourceTypes},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name", Method: "GET", Name: GetResource},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/check", Method: "POST", Name: CheckResource},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/check/webhook", Method: "POST", Name: CheckResourceWebHook},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resource-types/:resource_type_name/check", Method: "POST", Name: CheckResourceType},

	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions", Method: "GET", Name: ListResourceVersions},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_config_version_id", Method: "GET", Name: GetResourceVersion},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_config_version_id/enable", Method: "PUT", Name: EnableResourceVersion},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_config_version_id/disable", Method: "PUT", Name: DisableResourceVersion},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_config_version_id/pin", Method: "PUT", Name: PinResourceVersion},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/unpin", Method: "PUT", Name: UnpinResource},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/pin_comment", Method: "PUT", Name: SetPinCommentOnResource},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_config_version_id/input_to", Method: "GET", Name: ListBuildsWithVersionAsInput},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_config_version_id/output_of", Method: "GET", Name: ListBuildsWithVersionAsOutput},
	{Path: "/api/v1/teams/:team_name/pipelines/:pipeline_name/resources/:resource_name/versions/:resource_version_id/causality", Method: "GET", Name: GetResourceCausality},

	{Path: "/api/v1/teams/:team_name/cc.xml", Method: "GET", Name: GetCC},

	{Path: "/api/v1/workers", Method: "GET", Name: ListWorkers},
	{Path: "/api/v1/workers", Method: "POST", Name: RegisterWorker},
	{Path: "/api/v1/workers/:worker_name/land", Method: "PUT", Name: LandWorker},
	{Path: "/api/v1/workers/:worker_name/retire", Method: "PUT", Name: RetireWorker},
	{Path: "/api/v1/workers/:worker_name/prune", Method: "PUT", Name: PruneWorker},
	{Path: "/api/v1/workers/:worker_name/heartbeat", Method: "PUT", Name: HeartbeatWorker},
	{Path: "/api/v1/workers/:worker_name", Method: "DELETE", Name: DeleteWorker},

	{Path: "/api/v1/log-level", Method: "GET", Name: GetLogLevel},
	{Path: "/api/v1/log-level", Method: "PUT", Name: SetLogLevel},

	{Path: "/api/v1/cli", Method: "GET", Name: DownloadCLI},
	{Path: "/api/v1/info", Method: "GET", Name: GetInfo},
	{Path: "/api/v1/info/creds", Method: "GET", Name: GetInfoCreds},

	{Path: "/api/v1/user", Method: "GET", Name: GetUser},
	{Path: "/api/v1/users", Method: "GET", Name: ListActiveUsersSince},

	{Path: "/api/v1/containers/destroying", Method: "GET", Name: ListDestroyingContainers},
	{Path: "/api/v1/containers/report", Method: "PUT", Name: ReportWorkerContainers},
	{Path: "/api/v1/teams/:team_name/containers", Method: "GET", Name: ListContainers},
	{Path: "/api/v1/teams/:team_name/containers/:id", Method: "GET", Name: GetContainer},
	{Path: "/api/v1/teams/:team_name/containers/:id/hijack", Method: "GET", Name: HijackContainer},

	{Path: "/api/v1/teams/:team_name/volumes", Method: "GET", Name: ListVolumes},
	{Path: "/api/v1/volumes/destroying", Method: "GET", Name: ListDestroyingVolumes},
	{Path: "/api/v1/volumes/report", Method: "PUT", Name: ReportWorkerVolumes},

	{Path: "/api/v1/teams", Method: "GET", Name: ListTeams},
	{Path: "/api/v1/teams/:team_name", Method: "GET", Name: GetTeam},
	{Path: "/api/v1/teams/:team_name", Method: "PUT", Name: SetTeam},
	{Path: "/api/v1/teams/:team_name/rename", Method: "PUT", Name: RenameTeam},
	{Path: "/api/v1/teams/:team_name", Method: "DELETE", Name: DestroyTeam},
	{Path: "/api/v1/teams/:team_name/builds", Method: "GET", Name: ListTeamBuilds},

	{Path: "/api/v1/teams/:team_name/artifacts", Method: "POST", Name: CreateArtifact},
	{Path: "/api/v1/teams/:team_name/artifacts/:artifact_id", Method: "GET", Name: GetArtifact},

	{Path: "/api/v1/wall", Method: "GET", Name: GetWall},
	{Path: "/api/v1/wall", Method: "PUT", Name: SetWall},
	{Path: "/api/v1/wall", Method: "DELETE", Name: ClearWall},
})
View Source
var StepPrecedence = []StepDetector{
	{
		Key: "ensure",
		New: func() StepConfig { return &EnsureStep{} },
	},
	{
		Key: "on_error",
		New: func() StepConfig { return &OnErrorStep{} },
	},
	{
		Key: "on_abort",
		New: func() StepConfig { return &OnAbortStep{} },
	},
	{
		Key: "on_failure",
		New: func() StepConfig { return &OnFailureStep{} },
	},
	{
		Key: "on_success",
		New: func() StepConfig { return &OnSuccessStep{} },
	},
	{
		Key: "across",
		New: func() StepConfig { return &AcrossStep{} },
	},
	{
		Key: "attempts",
		New: func() StepConfig { return &RetryStep{} },
	},
	{
		Key: "timeout",
		New: func() StepConfig { return &TimeoutStep{} },
	},
	{
		Key: "task",
		New: func() StepConfig { return &TaskStep{} },
	},
	{
		Key: "put",
		New: func() StepConfig { return &PutStep{} },
	},
	{
		Key: "get",
		New: func() StepConfig { return &GetStep{} },
	},
	{
		Key: "set_pipeline",
		New: func() StepConfig { return &SetPipelineStep{} },
	},
	{
		Key: "load_var",
		New: func() StepConfig { return &LoadVarStep{} },
	},
	{
		Key: "try",
		New: func() StepConfig { return &TryStep{} },
	},
	{
		Key: "do",
		New: func() StepConfig { return &DoStep{} },
	},
	{
		Key: "in_parallel",
		New: func() StepConfig { return &InParallelStep{} },
	},
	{
		Key: "aggregate",
		New: func() StepConfig { return &AggregateStep{} },
	},
}

StepPrecedence is a static list of all of the step types, listed in the order that they should be parsed. Broadly, modifiers are parsed first - with some important inter-modifier precedence - while core step types are parsed last.

Functions ¶

func DefaultSSHConfig ¶

func DefaultSSHConfig() ssh.Config

func DefaultTLSConfig ¶

func DefaultTLSConfig() *tls.Config

func LoadBaseResourceTypeDefaults ¶

func LoadBaseResourceTypeDefaults(defaults map[string]Source)

func UnmarshalConfig ¶

func UnmarshalConfig(payload []byte, config interface{}) error

Types ¶

type AcrossPlan ¶

type AcrossPlan struct {
	Vars     []AcrossVar     `json:"vars"`
	Steps    []VarScopedPlan `json:"steps"`
	FailFast bool            `json:"fail_fast,omitempty"`
}

func (AcrossPlan) Public ¶

func (plan AcrossPlan) Public() *json.RawMessage

type AcrossStep ¶

type AcrossStep struct {
	Step     StepConfig        `json:"-"`
	Vars     []AcrossVarConfig `json:"across"`
	FailFast bool              `json:"fail_fast,omitempty"`
}

func (*AcrossStep) ParseJSON ¶

func (step *AcrossStep) ParseJSON(data []byte) error

func (*AcrossStep) Unwrap ¶

func (step *AcrossStep) Unwrap() StepConfig

func (*AcrossStep) Visit ¶

func (step *AcrossStep) Visit(v StepVisitor) error

func (*AcrossStep) Wrap ¶

func (step *AcrossStep) Wrap(sub StepConfig)

type AcrossVar ¶

type AcrossVar struct {
	Var         string             `json:"name"`
	Values      []interface{}      `json:"values"`
	MaxInFlight *MaxInFlightConfig `json:"max_in_flight,omitempty"`
}

type AcrossVarConfig ¶

type AcrossVarConfig struct {
	Var         string             `json:"var"`
	Values      []interface{}      `json:"values,omitempty"`
	MaxInFlight *MaxInFlightConfig `json:"max_in_flight,omitempty"`
}

func (*AcrossVarConfig) UnmarshalJSON ¶

func (config *AcrossVarConfig) UnmarshalJSON(data []byte) error

type AggregatePlan ¶

type AggregatePlan []Plan

func (AggregatePlan) Public ¶

func (plan AggregatePlan) Public() *json.RawMessage

type AggregateStep ¶

type AggregateStep struct {
	Steps []Step `json:"aggregate"`
}

func (*AggregateStep) Visit ¶

func (step *AggregateStep) Visit(v StepVisitor) error

type ArtifactInputPlan ¶

type ArtifactInputPlan struct {
	ArtifactID int    `json:"artifact_id"`
	Name       string `json:"name"`
}

func (ArtifactInputPlan) Public ¶

func (plan ArtifactInputPlan) Public() *json.RawMessage

type ArtifactOutputPlan ¶

type ArtifactOutputPlan struct {
	Name string `json:"name"`
}

func (ArtifactOutputPlan) Public ¶

func (plan ArtifactOutputPlan) Public() *json.RawMessage

type Build ¶

type Build struct {
	ID                   int           `json:"id"`
	TeamName             string        `json:"team_name"`
	Name                 string        `json:"name"`
	Status               BuildStatus   `json:"status"`
	APIURL               string        `json:"api_url"`
	JobName              string        `json:"job_name,omitempty"`
	ResourceName         string        `json:"resource_name,omitempty"`
	PipelineID           int           `json:"pipeline_id,omitempty"`
	PipelineName         string        `json:"pipeline_name,omitempty"`
	PipelineInstanceVars InstanceVars  `json:"pipeline_instance_vars,omitempty"`
	StartTime            int64         `json:"start_time,omitempty"`
	EndTime              int64         `json:"end_time,omitempty"`
	ReapTime             int64         `json:"reap_time,omitempty"`
	RerunNumber          int           `json:"rerun_number,omitempty"`
	RerunOf              *RerunOfBuild `json:"rerun_of,omitempty"`
}

func (Build) Abortable ¶

func (b Build) Abortable() bool

func (Build) IsRunning ¶

func (b Build) IsRunning() bool

func (Build) OneOff ¶

func (b Build) OneOff() bool

type BuildInput ¶

type BuildInput struct {
	Name     string   `json:"name"`
	Resource string   `json:"resource"`
	Type     string   `json:"type"`
	Source   Source   `json:"source"`
	Params   Params   `json:"params,omitempty"`
	Version  Version  `json:"version"`
	Tags     []string `json:"tags,omitempty"`
}

type BuildInputsOutputs ¶

type BuildInputsOutputs struct {
	Inputs  []PublicBuildInput  `json:"inputs"`
	Outputs []PublicBuildOutput `json:"outputs"`
}

type BuildLogRetention ¶

type BuildLogRetention struct {
	Builds                 int `json:"builds,omitempty"`
	MinimumSucceededBuilds int `json:"minimum_succeeded_builds,omitempty"`
	Days                   int `json:"days,omitempty"`
}

type BuildPreparation ¶

type BuildPreparation struct {
	BuildID             int                               `json:"build_id"`
	PausedPipeline      BuildPreparationStatus            `json:"paused_pipeline"`
	PausedJob           BuildPreparationStatus            `json:"paused_job"`
	MaxRunningBuilds    BuildPreparationStatus            `json:"max_running_builds"`
	Inputs              map[string]BuildPreparationStatus `json:"inputs"`
	InputsSatisfied     BuildPreparationStatus            `json:"inputs_satisfied"`
	MissingInputReasons MissingInputReasons               `json:"missing_input_reasons"`
}

type BuildPreparationStatus ¶

type BuildPreparationStatus string
const (
	BuildPreparationStatusUnknown     BuildPreparationStatus = "unknown"
	BuildPreparationStatusBlocking    BuildPreparationStatus = "blocking"
	BuildPreparationStatusNotBlocking BuildPreparationStatus = "not_blocking"
)

type BuildStatus ¶

type BuildStatus string
const (
	StatusStarted   BuildStatus = "started"
	StatusPending   BuildStatus = "pending"
	StatusSucceeded BuildStatus = "succeeded"
	StatusFailed    BuildStatus = "failed"
	StatusErrored   BuildStatus = "errored"
	StatusAborted   BuildStatus = "aborted"
)

func (BuildStatus) String ¶

func (status BuildStatus) String() string

type BuildSummary ¶

type BuildSummary struct {
	ID   int    `json:"id"`
	Name string `json:"name"`

	Status BuildStatus `json:"status"`

	StartTime int64 `json:"start_time,omitempty"`
	EndTime   int64 `json:"end_time,omitempty"`

	TeamName string `json:"team_name"`

	PipelineID           int          `json:"pipeline_id"`
	PipelineName         string       `json:"pipeline_name"`
	PipelineInstanceVars InstanceVars `json:"pipeline_instance_vars,omitempty"`

	JobName string `json:"job_name,omitempty"`
}

type CPULimit ¶

type CPULimit uint64

func (*CPULimit) UnmarshalJSON ¶

func (c *CPULimit) UnmarshalJSON(data []byte) error

type CheckPlan ¶

type CheckPlan struct {
	// The name of the step.
	Name string `json:"name"`

	// The resource config to check.
	Type                   string                 `json:"type"`
	Source                 Source                 `json:"source"`
	VersionedResourceTypes VersionedResourceTypes `json:"resource_types,omitempty"`

	// The version to check from. If not specified, defaults to the latest
	// version of the config.
	FromVersion Version `json:"from_version,omitempty"`

	// A pipeline resource or resource type to assign the config to.
	Resource     string `json:"resource,omitempty"`
	ResourceType string `json:"resource_type,omitempty"`

	// The interval on which to check - if it has not elapsed since the config
	// was last checked, and the build has not been manually triggered, the check
	// will be skipped.
	Interval string `json:"interval,omitempty"`

	// A timeout to enforce on the check operation.
	Timeout string `json:"timeout,omitempty"`

	// Worker tags to influence placement of the container.
	Tags Tags `json:"tags,omitempty"`
}

func (CheckPlan) Public ¶

func (plan CheckPlan) Public() *json.RawMessage

type CheckRequestBody ¶

type CheckRequestBody struct {
	From Version `json:"from"`
}

type ClearTaskCacheResponse ¶

type ClearTaskCacheResponse struct {
	CachesRemoved int64 `json:"caches_removed"`
}

type CoercedString ¶

type CoercedString string

func (*CoercedString) UnmarshalJSON ¶

func (cs *CoercedString) UnmarshalJSON(p []byte) error

type Component ¶

type Component struct {
	Name     string
	Interval time.Duration
}

type Config ¶

type Config struct {
	Groups        GroupConfigs     `json:"groups,omitempty"`
	VarSources    VarSourceConfigs `json:"var_sources,omitempty"`
	Resources     ResourceConfigs  `json:"resources,omitempty"`
	ResourceTypes ResourceTypes    `json:"resource_types,omitempty"`
	Jobs          JobConfigs       `json:"jobs,omitempty"`
	Display       *DisplayConfig   `json:"display,omitempty"`
}

func (Config) Diff ¶

func (c Config) Diff(out io.Writer, newConfig Config) bool

func (Config) JobIsPublic ¶

func (config Config) JobIsPublic(jobName string) (bool, error)

type ConfigResponse ¶

type ConfigResponse struct {
	Config Config `json:"config"`
}

type ConfigWarning ¶

type ConfigWarning struct {
	Type    string `json:"type"`
	Message string `json:"message"`
}

func ValidateIdentifier ¶

func ValidateIdentifier(identifier string, context ...string) *ConfigWarning

type Container ¶

type Container struct {
	ID         string `json:"id"`
	WorkerName string `json:"worker_name"`

	State string `json:"state,omitempty"`
	Type  string `json:"type,omitempty"`

	StepName string `json:"step_name,omitempty"`
	Attempt  string `json:"attempt,omitempty"`

	PipelineID     int `json:"pipeline_id,omitempty"`
	JobID          int `json:"job_id,omitempty"`
	BuildID        int `json:"build_id,omitempty"`
	ResourceID     int `json:"resource_id,omitempty"`
	ResourceTypeID int `json:"resource_type_id,omitempty"`

	PipelineName         string       `json:"pipeline_name,omitempty"`
	PipelineInstanceVars InstanceVars `json:"pipeline_instance_vars,omitempty"`

	JobName          string `json:"job_name,omitempty"`
	BuildName        string `json:"build_name,omitempty"`
	ResourceName     string `json:"resource_name,omitempty"`
	ResourceTypeName string `json:"resource_type_name,omitempty"`

	User             string `json:"user,omitempty"`
	WorkingDirectory string `json:"working_directory,omitempty"`

	ExpiresIn string `json:"expires_in,omitempty"`
}

type ContainerLimits ¶

type ContainerLimits struct {
	CPU    *CPULimit    `json:"cpu,omitempty"`
	Memory *MemoryLimit `json:"memory,omitempty"`
}

type DebugBuildInput ¶

type DebugBuildInput struct {
	DebugResourceVersion
	BuildID   int
	JobID     int
	InputName string
}

type DebugBuildOutput ¶

type DebugBuildOutput struct {
	DebugResourceVersion
	BuildID int
	JobID   int
}

type DebugBuildRerun ¶

type DebugBuildRerun struct {
	BuildID int
	JobID   int
	RerunOf int
}

type DebugJob ¶

type DebugJob struct {
	Name string
	ID   int
}

type DebugResource ¶

type DebugResource struct {
	Name    string
	ID      int
	ScopeID *int
}

type DebugResourceVersion ¶

type DebugResourceVersion struct {
	VersionID  int
	ResourceID int
	CheckOrder int

	// not present pre-6.0
	ScopeID int
}

type DebugVersionsDB ¶

type DebugVersionsDB struct {
	Jobs             []DebugJob
	Resources        []DebugResource
	ResourceVersions []DebugResourceVersion
	BuildOutputs     []DebugBuildOutput
	BuildInputs      []DebugBuildInput
	BuildReruns      []DebugBuildRerun

	// backwards-compatibility with pre-6.0 VersionsDB
	LegacyJobIDs      map[string]int `json:"JobIDs,omitempty"`
	LegacyResourceIDs map[string]int `json:"ResourceIDs,omitempty"`
}

type DependentGetPlan ¶

type DependentGetPlan struct {
	Type     string `json:"type"`
	Name     string `json:"name,omitempty"`
	Resource string `json:"resource"`
}

func (DependentGetPlan) Public ¶

func (plan DependentGetPlan) Public() *json.RawMessage

type Diff ¶

type Diff struct {
	Before interface{}
	After  interface{}
}

func (Diff) Render ¶

func (diff Diff) Render(to io.Writer, label string)

type Diffs ¶

type Diffs []Diff

type DisplayConfig ¶

type DisplayConfig struct {
	BackgroundImage string `json:"background_image,omitempty"`
}

type DisplayDiff ¶

type DisplayDiff struct {
	Before *DisplayConfig
	After  *DisplayConfig
}

func (DisplayDiff) Render ¶

func (diff DisplayDiff) Render(to io.Writer)

type DoPlan ¶

type DoPlan []Plan

func (DoPlan) Public ¶

func (plan DoPlan) Public() *json.RawMessage

type DoStep ¶

type DoStep struct {
	Steps []Step `json:"do"`
}

func (*DoStep) Visit ¶

func (step *DoStep) Visit(v StepVisitor) error

type EnsurePlan ¶

type EnsurePlan struct {
	Step Plan `json:"step"`
	Next Plan `json:"ensure"`
}

func (EnsurePlan) Public ¶

func (plan EnsurePlan) Public() *json.RawMessage

type EnsureStep ¶

type EnsureStep struct {
	Step StepConfig `json:"-"`
	Hook Step       `json:"ensure"`
}

func (*EnsureStep) Unwrap ¶

func (step *EnsureStep) Unwrap() StepConfig

func (*EnsureStep) Visit ¶

func (step *EnsureStep) Visit(v StepVisitor) error

func (*EnsureStep) Wrap ¶

func (step *EnsureStep) Wrap(sub StepConfig)

type Event ¶

type Event interface {
	EventType() EventType
	Version() EventVersion
}

Event represents an event emitted by a build. They are interpreted as a stream to render the build's output.

type EventType ¶

type EventType string

EventType is a classification of an event payload, associated to a struct to parse it into.

type EventVersion ¶

type EventVersion string

EventVersion is a MAJOR.MINOR version corresponding to an event type.

Minor bumps must be backwards-compatible, meaning older clients can still unmarshal them into their old type and still handle the event.

An example of a minor bump would be an additive change, i.e. a new field.

Major bumps are backwards-incompatible and must be parsed and handled differently. An example of a major bump would be the changing or removal of a field.

func (EventVersion) IsCompatibleWith ¶

func (version EventVersion) IsCompatibleWith(other EventVersion) bool

IsCompatibleWith checks whether the versions have the same major version.

type GetPlan ¶

type GetPlan struct {
	// The name of the step.
	Name string `json:"name,omitempty"`

	// The resource config to fetch from.
	Type                   string                 `json:"type"`
	Source                 Source                 `json:"source"`
	VersionedResourceTypes VersionedResourceTypes `json:"resource_types,omitempty"`

	// The version of the resource to fetch. One of these must be specified.
	Version     *Version `json:"version,omitempty"`
	VersionFrom *PlanID  `json:"version_from,omitempty"`

	// Params to pass to the get operation.
	Params Params `json:"params,omitempty"`

	// A pipeline resource to update with metadata.
	Resource string `json:"resource,omitempty"`

	// Worker tags to influence placement of the container.
	Tags Tags `json:"tags,omitempty"`
}

func (GetPlan) Public ¶

func (plan GetPlan) Public() *json.RawMessage

type GetStep ¶

type GetStep struct {
	Name     string         `json:"get"`
	Resource string         `json:"resource,omitempty"`
	Version  *VersionConfig `json:"version,omitempty"`
	Params   Params         `json:"params,omitempty"`
	Passed   []string       `json:"passed,omitempty"`
	Trigger  bool           `json:"trigger,omitempty"`
	Tags     Tags           `json:"tags,omitempty"`
}

func (*GetStep) ResourceName ¶

func (step *GetStep) ResourceName() string

func (*GetStep) Visit ¶

func (step *GetStep) Visit(v StepVisitor) error

type GroupConfig ¶

type GroupConfig struct {
	Name      string   `json:"name"`
	Jobs      []string `json:"jobs,omitempty"`
	Resources []string `json:"resources,omitempty"`
}

type GroupConfigs ¶

type GroupConfigs []GroupConfig

func (GroupConfigs) Lookup ¶

func (groups GroupConfigs) Lookup(name string) (GroupConfig, int, bool)

type GroupIndex ¶

type GroupIndex GroupConfigs

func (GroupIndex) FindEquivalentWithOrder ¶

func (index GroupIndex) FindEquivalentWithOrder(obj interface{}) (interface{}, int, bool)

func (GroupIndex) Slice ¶

func (index GroupIndex) Slice() []interface{}

type HijackInput ¶

type HijackInput struct {
	Closed  bool           `json:"closed,omitempty"`
	Stdin   []byte         `json:"stdin,omitempty"`
	TTYSpec *HijackTTYSpec `json:"tty,omitempty"`
}

type HijackOutput ¶

type HijackOutput struct {
	Stdout             []byte `json:"stdout,omitempty"`
	Stderr             []byte `json:"stderr,omitempty"`
	Error              string `json:"error,omitempty"`
	ExitStatus         *int   `json:"exit_status,omitempty"`
	ExecutableNotFound bool   `json:"executable_not_found,omitempty"`
}

type HijackProcessSpec ¶

type HijackProcessSpec struct {
	Path string   `json:"path"`
	Args []string `json:"args"`
	Env  []string `json:"env"`
	Dir  string   `json:"dir"`

	Privileged bool   `json:"privileged"`
	User       string `json:"user"`

	TTY *HijackTTYSpec `json:"tty"`
}

type HijackTTYSpec ¶

type HijackTTYSpec struct {
	WindowSize HijackWindowSize `json:"window_size"`
}

type HijackWindowSize ¶

type HijackWindowSize struct {
	Columns int `json:"columns"`
	Rows    int `json:"rows"`
}

type ImageResource ¶

type ImageResource struct {
	Name    string  `json:"name"`
	Type    string  `json:"type"`
	Source  Source  `json:"source"`
	Version Version `json:"version,omitempty"`
	Params  Params  `json:"params,omitempty"`
	Tags    Tags    `json:"tags,omitempty"`
}

func (*ImageResource) ApplySourceDefaults ¶

func (ir *ImageResource) ApplySourceDefaults(resourceTypes VersionedResourceTypes)

type InParallelConfig ¶

type InParallelConfig struct {
	Steps    []Step `json:"steps,omitempty"`
	Limit    int    `json:"limit,omitempty"`
	FailFast bool   `json:"fail_fast,omitempty"`
}

func (*InParallelConfig) UnmarshalJSON ¶

func (c *InParallelConfig) UnmarshalJSON(payload []byte) error

type InParallelPlan ¶

type InParallelPlan struct {
	Steps    []Plan `json:"steps"`
	Limit    int    `json:"limit,omitempty"`
	FailFast bool   `json:"fail_fast,omitempty"`
}

func (InParallelPlan) Public ¶

func (plan InParallelPlan) Public() *json.RawMessage

type InParallelStep ¶

type InParallelStep struct {
	Config InParallelConfig `json:"in_parallel"`
}

func (*InParallelStep) Visit ¶

func (step *InParallelStep) Visit(v StepVisitor) error

type Index ¶

type Index interface {
	FindEquivalent(interface{}) (interface{}, bool)
	Slice() []interface{}
}

type Info ¶

type Info struct {
	Version       string `json:"version"`
	WorkerVersion string `json:"worker_version"`
	ExternalURL   string `json:"external_url,omitempty"`
	ClusterName   string `json:"cluster_name,omitempty"`
}

type InputsConfig ¶

type InputsConfig struct {
	All       bool
	Detect    bool
	Specified []string
}

A InputsConfig represents the choice to include every artifact within the job as an input to the put step or specific ones.

func (InputsConfig) MarshalJSON ¶

func (c InputsConfig) MarshalJSON() ([]byte, error)

func (*InputsConfig) UnmarshalJSON ¶

func (c *InputsConfig) UnmarshalJSON(inputs []byte) error

type InstanceVars ¶

type InstanceVars map[string]interface{}

func (InstanceVars) String ¶

func (iv InstanceVars) String() string

type Job ¶

type Job struct {
	ID   int    `json:"id"`
	Name string `json:"name"`

	TeamName string `json:"team_name"`

	PipelineID           int          `json:"pipeline_id"`
	PipelineName         string       `json:"pipeline_name"`
	PipelineInstanceVars InstanceVars `json:"pipeline_instance_vars,omitempty"`

	Paused       bool `json:"paused,omitempty"`
	HasNewInputs bool `json:"has_new_inputs,omitempty"`

	Groups []string `json:"groups,omitempty"`

	FirstLoggedBuildID   int  `json:"first_logged_build_id,omitempty"`
	DisableManualTrigger bool `json:"disable_manual_trigger,omitempty"`

	NextBuild       *Build `json:"next_build"`
	FinishedBuild   *Build `json:"finished_build"`
	TransitionBuild *Build `json:"transition_build,omitempty"`

	Inputs  []JobInput  `json:"inputs,omitempty"`
	Outputs []JobOutput `json:"outputs,omitempty"`
}

type JobConfig ¶

type JobConfig struct {
	Name    string `json:"name"`
	OldName string `json:"old_name,omitempty"`
	Public  bool   `json:"public,omitempty"`

	DisableManualTrigger bool     `json:"disable_manual_trigger,omitempty"`
	Serial               bool     `json:"serial,omitempty"`
	Interruptible        bool     `json:"interruptible,omitempty"`
	SerialGroups         []string `json:"serial_groups,omitempty"`
	RawMaxInFlight       int      `json:"max_in_flight,omitempty"`
	BuildLogsToRetain    int      `json:"build_logs_to_retain,omitempty"`

	BuildLogRetention *BuildLogRetention `json:"build_log_retention,omitempty"`

	OnSuccess *Step `json:"on_success,omitempty"`
	OnFailure *Step `json:"on_failure,omitempty"`
	OnAbort   *Step `json:"on_abort,omitempty"`
	OnError   *Step `json:"on_error,omitempty"`
	Ensure    *Step `json:"ensure,omitempty"`

	PlanSequence []Step `json:"plan"`
}

func (JobConfig) Inputs ¶

func (config JobConfig) Inputs() []JobInputParams

func (JobConfig) MaxInFlight ¶

func (config JobConfig) MaxInFlight() int

func (JobConfig) Outputs ¶

func (config JobConfig) Outputs() []JobOutput

func (JobConfig) Step ¶

func (config JobConfig) Step() Step

func (JobConfig) StepConfig ¶

func (config JobConfig) StepConfig() StepConfig

type JobConfigs ¶

type JobConfigs []JobConfig

func (JobConfigs) Lookup ¶

func (jobs JobConfigs) Lookup(name string) (JobConfig, bool)

type JobIndex ¶

type JobIndex JobConfigs

func (JobIndex) FindEquivalent ¶

func (index JobIndex) FindEquivalent(obj interface{}) (interface{}, bool)

func (JobIndex) Slice ¶

func (index JobIndex) Slice() []interface{}

type JobInput ¶

type JobInput struct {
	Name     string         `json:"name"`
	Resource string         `json:"resource"`
	Trigger  bool           `json:"trigger"`
	Passed   []string       `json:"passed,omitempty"`
	Version  *VersionConfig `json:"version,omitempty"`
}

type JobInputParams ¶

type JobInputParams struct {
	JobInput
	Params Params `json:"params,omitempty"`
	Tags   Tags   `json:"tags,omitempty"`
}

type JobInputSummary ¶

type JobInputSummary struct {
	Name     string   `json:"name"`
	Resource string   `json:"resource"`
	Passed   []string `json:"passed,omitempty"`
	Trigger  bool     `json:"trigger,omitempty"`
}

type JobOutput ¶

type JobOutput struct {
	Name     string `json:"name"`
	Resource string `json:"resource"`
}

type JobOutputSummary ¶

type JobOutputSummary struct {
	Name     string `json:"name"`
	Resource string `json:"resource"`
}

type JobSummary ¶

type JobSummary struct {
	ID   int    `json:"id"`
	Name string `json:"name"`

	TeamName string `json:"team_name"`

	PipelineID           int          `json:"pipeline_id"`
	PipelineName         string       `json:"pipeline_name"`
	PipelineInstanceVars InstanceVars `json:"pipeline_instance_vars,omitempty"`

	Paused       bool `json:"paused,omitempty"`
	HasNewInputs bool `json:"has_new_inputs,omitempty"`

	Groups []string `json:"groups,omitempty"`

	FinishedBuild   *BuildSummary `json:"finished_build,omitempty"`
	NextBuild       *BuildSummary `json:"next_build,omitempty"`
	TransitionBuild *BuildSummary `json:"transition_build,omitempty"`

	Inputs  []JobInputSummary  `json:"inputs,omitempty"`
	Outputs []JobOutputSummary `json:"outputs,omitempty"`
}

type LoadVarPlan ¶

type LoadVarPlan struct {
	Name   string `json:"name"`
	File   string `json:"file"`
	Format string `json:"format,omitempty"`
	Reveal bool   `json:"reveal,omitempty"`
}

func (LoadVarPlan) Public ¶

func (plan LoadVarPlan) Public() *json.RawMessage

type LoadVarStep ¶

type LoadVarStep struct {
	Name   string `json:"load_var"`
	File   string `json:"file,omitempty"`
	Format string `json:"format,omitempty"`
	Reveal bool   `json:"reveal,omitempty"`
}

func (*LoadVarStep) Visit ¶

func (step *LoadVarStep) Visit(v StepVisitor) error

type LogLevel ¶

type LogLevel string
const (
	LogLevelInvalid LogLevel = ""
	LogLevelDebug   LogLevel = "debug"
	LogLevelInfo    LogLevel = "info"
	LogLevelError   LogLevel = "error"
	LogLevelFatal   LogLevel = "fatal"
)

type MalformedConfigError ¶

type MalformedConfigError struct {
	UnmarshalError error
}

func (MalformedConfigError) Error ¶

func (err MalformedConfigError) Error() string

type MalformedStepError ¶

type MalformedStepError struct {
	StepType string
	Err      error
}

func (MalformedStepError) Error ¶

func (err MalformedStepError) Error() string

func (MalformedStepError) Unwrap ¶

func (err MalformedStepError) Unwrap() error

type MaxInFlightConfig ¶

type MaxInFlightConfig struct {
	All   bool
	Limit int
}

MaxInFlightConfig can represent either running all values in an AcrossStep in parallel or a applying a limit to the sub-steps that can run at once.

func (*MaxInFlightConfig) EffectiveLimit ¶

func (c *MaxInFlightConfig) EffectiveLimit(numSteps int) int

func (*MaxInFlightConfig) MarshalJSON ¶

func (c *MaxInFlightConfig) MarshalJSON() ([]byte, error)

func (*MaxInFlightConfig) UnmarshalJSON ¶

func (c *MaxInFlightConfig) UnmarshalJSON(version []byte) error

type MemoryLimit ¶

type MemoryLimit uint64

func ParseMemoryLimit ¶

func ParseMemoryLimit(limit string) (MemoryLimit, error)

func (*MemoryLimit) UnmarshalJSON ¶

func (m *MemoryLimit) UnmarshalJSON(data []byte) error

type MetadataField ¶

type MetadataField struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type MissingInputReasons ¶

type MissingInputReasons map[string]string

type OnAbortPlan ¶

type OnAbortPlan struct {
	Step Plan `json:"step"`
	Next Plan `json:"on_abort"`
}

func (OnAbortPlan) Public ¶

func (plan OnAbortPlan) Public() *json.RawMessage

type OnAbortStep ¶

type OnAbortStep struct {
	Step StepConfig `json:"-"`
	Hook Step       `json:"on_abort"`
}

func (*OnAbortStep) Unwrap ¶

func (step *OnAbortStep) Unwrap() StepConfig

func (*OnAbortStep) Visit ¶

func (step *OnAbortStep) Visit(v StepVisitor) error

func (*OnAbortStep) Wrap ¶

func (step *OnAbortStep) Wrap(sub StepConfig)

type OnErrorPlan ¶

type OnErrorPlan struct {
	Step Plan `json:"step"`
	Next Plan `json:"on_error"`
}

func (OnErrorPlan) Public ¶

func (plan OnErrorPlan) Public() *json.RawMessage

type OnErrorStep ¶

type OnErrorStep struct {
	Step StepConfig `json:"-"`
	Hook Step       `json:"on_error"`
}

func (*OnErrorStep) Unwrap ¶

func (step *OnErrorStep) Unwrap() StepConfig

func (*OnErrorStep) Visit ¶

func (step *OnErrorStep) Visit(v StepVisitor) error

func (*OnErrorStep) Wrap ¶

func (step *OnErrorStep) Wrap(sub StepConfig)

type OnFailurePlan ¶

type OnFailurePlan struct {
	Step Plan `json:"step"`
	Next Plan `json:"on_failure"`
}

func (OnFailurePlan) Public ¶

func (plan OnFailurePlan) Public() *json.RawMessage

type OnFailureStep ¶

type OnFailureStep struct {
	Step StepConfig `json:"-"`
	Hook Step       `json:"on_failure"`
}

func (*OnFailureStep) Unwrap ¶

func (step *OnFailureStep) Unwrap() StepConfig

func (*OnFailureStep) Visit ¶

func (step *OnFailureStep) Visit(v StepVisitor) error

func (*OnFailureStep) Wrap ¶

func (step *OnFailureStep) Wrap(sub StepConfig)

type OnSuccessPlan ¶

type OnSuccessPlan struct {
	Step Plan `json:"step"`
	Next Plan `json:"on_success"`
}

func (OnSuccessPlan) Public ¶

func (plan OnSuccessPlan) Public() *json.RawMessage

type OnSuccessStep ¶

type OnSuccessStep struct {
	Step StepConfig `json:"-"`
	Hook Step       `json:"on_success"`
}

func (*OnSuccessStep) Unwrap ¶

func (step *OnSuccessStep) Unwrap() StepConfig

func (*OnSuccessStep) Visit ¶

func (step *OnSuccessStep) Visit(v StepVisitor) error

func (*OnSuccessStep) Wrap ¶

func (step *OnSuccessStep) Wrap(sub StepConfig)

type OrderPipelinesRequest ¶

type OrderPipelinesRequest []PipelineRef

func (OrderPipelinesRequest) Len ¶

func (r OrderPipelinesRequest) Len() int

func (OrderPipelinesRequest) Less ¶

func (r OrderPipelinesRequest) Less(i, j int) bool

func (OrderPipelinesRequest) Swap ¶

func (r OrderPipelinesRequest) Swap(i, j int)

type Params ¶

type Params map[string]interface{}

func (Params) MarshalJSON ¶

func (ps Params) MarshalJSON() ([]byte, error)

type PathFlag ¶

type PathFlag string

func (*PathFlag) Complete ¶

func (path *PathFlag) Complete(match string) []flags.Completion

func (*PathFlag) FromStdin ¶

func (path *PathFlag) FromStdin() bool

func (*PathFlag) UnmarshalFlag ¶

func (path *PathFlag) UnmarshalFlag(value string) error

type Pipe ¶

type Pipe struct {
	ID string `json:"id"`

	ReadURL  string `json:"read_url"`
	WriteURL string `json:"write_url"`
}

type Pipeline ¶

type Pipeline struct {
	ID           int            `json:"id"`
	Name         string         `json:"name"`
	InstanceVars InstanceVars   `json:"instance_vars,omitempty"`
	Paused       bool           `json:"paused"`
	Public       bool           `json:"public"`
	Archived     bool           `json:"archived"`
	Groups       GroupConfigs   `json:"groups,omitempty"`
	TeamName     string         `json:"team_name"`
	Display      *DisplayConfig `json:"display,omitempty"`
	LastUpdated  int64          `json:"last_updated,omitempty"`
}

func (Pipeline) Ref ¶

func (p Pipeline) Ref() PipelineRef

type PipelineRef ¶

type PipelineRef struct {
	Name         string       `json:"name"`
	InstanceVars InstanceVars `json:"instance_vars,omitempty"`
}

func (PipelineRef) QueryParams ¶

func (ref PipelineRef) QueryParams() url.Values

func (PipelineRef) String ¶

func (ref PipelineRef) String() string

type Plan ¶

type Plan struct {
	ID       PlanID `json:"id"`
	Attempts []int  `json:"attempts,omitempty"`

	Get         *GetPlan         `json:"get,omitempty"`
	Put         *PutPlan         `json:"put,omitempty"`
	Check       *CheckPlan       `json:"check,omitempty"`
	Task        *TaskPlan        `json:"task,omitempty"`
	SetPipeline *SetPipelinePlan `json:"set_pipeline,omitempty"`
	LoadVar     *LoadVarPlan     `json:"load_var,omitempty"`

	Do         *DoPlan         `json:"do,omitempty"`
	InParallel *InParallelPlan `json:"in_parallel,omitempty"`
	Aggregate  *AggregatePlan  `json:"aggregate,omitempty"`
	Across     *AcrossPlan     `json:"across,omitempty"`

	OnSuccess *OnSuccessPlan `json:"on_success,omitempty"`
	OnFailure *OnFailurePlan `json:"on_failure,omitempty"`
	OnAbort   *OnAbortPlan   `json:"on_abort,omitempty"`
	OnError   *OnErrorPlan   `json:"on_error,omitempty"`
	Ensure    *EnsurePlan    `json:"ensure,omitempty"`

	Try     *TryPlan     `json:"try,omitempty"`
	Timeout *TimeoutPlan `json:"timeout,omitempty"`
	Retry   *RetryPlan   `json:"retry,omitempty"`

	// used for 'fly execute'
	ArtifactInput  *ArtifactInputPlan  `json:"artifact_input,omitempty"`
	ArtifactOutput *ArtifactOutputPlan `json:"artifact_output,omitempty"`

	// deprecated, kept for backwards compatibility to be able to show old builds
	DependentGet *DependentGetPlan `json:"dependent_get,omitempty"`
}

func (*Plan) Each ¶

func (plan *Plan) Each(f func(*Plan))

func (Plan) Public ¶

func (plan Plan) Public() *json.RawMessage

type PlanConfig ¶

type PlanConfig interface {
	Public() *json.RawMessage
}

type PlanFactory ¶

type PlanFactory struct {
	// contains filtered or unexported fields
}

func NewPlanFactory ¶

func NewPlanFactory(startingNum int64) PlanFactory

func (PlanFactory) NewPlan ¶

func (factory PlanFactory) NewPlan(step PlanConfig) Plan

type PlanID ¶

type PlanID string

func (PlanID) String ¶

func (id PlanID) String() string

type PruneWorkerResponseBody ¶

type PruneWorkerResponseBody struct {
	Stderr string `json:"stderr"`
}

type PublicBuildInput ¶

type PublicBuildInput struct {
	Name            string  `json:"name"`
	Version         Version `json:"version"`
	PipelineID      int     `json:"pipeline_id"`
	FirstOccurrence bool    `json:"first_occurrence"`
}

type PublicBuildOutput ¶

type PublicBuildOutput struct {
	Name    string  `json:"name"`
	Version Version `json:"version"`
}

type PublicBuildPlan ¶

type PublicBuildPlan struct {
	Schema string           `json:"schema"`
	Plan   *json.RawMessage `json:"plan"`
}

type PutPlan ¶

type PutPlan struct {
	// The name of the step.
	Name string `json:"name"`

	// The resource config to push to.
	Type                   string                 `json:"type"`
	Source                 Source                 `json:"source"`
	VersionedResourceTypes VersionedResourceTypes `json:"resource_types,omitempty"`

	// Params to pass to the put operation.
	Params Params `json:"params,omitempty"`

	// Inputs to pass to the put operation.
	Inputs *InputsConfig `json:"inputs,omitempty"`

	// A pipeline resource to save the versions onto.
	Resource string `json:"resource,omitempty"`

	// Worker tags to influence placement of the container.
	Tags Tags `json:"tags,omitempty"`
}

func (PutPlan) Public ¶

func (plan PutPlan) Public() *json.RawMessage

type PutStep ¶

type PutStep struct {
	Name      string        `json:"put"`
	Resource  string        `json:"resource,omitempty"`
	Params    Params        `json:"params,omitempty"`
	Inputs    *InputsConfig `json:"inputs,omitempty"`
	Tags      Tags          `json:"tags,omitempty"`
	GetParams Params        `json:"get_params,omitempty"`
}

func (*PutStep) ResourceName ¶

func (step *PutStep) ResourceName() string

func (*PutStep) Visit ¶

func (step *PutStep) Visit(v StepVisitor) error

type RenameRequest ¶

type RenameRequest struct {
	NewName string `json:"name"`
}

type RerunOfBuild ¶

type RerunOfBuild struct {
	ID   int    `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

type Resource ¶

type Resource struct {
	Name                 string       `json:"name"`
	PipelineID           int          `json:"pipeline_id"`
	PipelineName         string       `json:"pipeline_name"`
	PipelineInstanceVars InstanceVars `json:"pipeline_instance_vars,omitempty"`
	TeamName             string       `json:"team_name"`
	Type                 string       `json:"type"`
	LastChecked          int64        `json:"last_checked,omitempty"`
	Icon                 string       `json:"icon,omitempty"`

	PinnedVersion  Version `json:"pinned_version,omitempty"`
	PinnedInConfig bool    `json:"pinned_in_config,omitempty"`
	PinComment     string  `json:"pin_comment,omitempty"`

	Build *BuildSummary `json:"build,omitempty"`
}

type ResourceConfig ¶

type ResourceConfig struct {
	Name         string  `json:"name"`
	OldName      string  `json:"old_name,omitempty"`
	Public       bool    `json:"public,omitempty"`
	WebhookToken string  `json:"webhook_token,omitempty"`
	Type         string  `json:"type"`
	Source       Source  `json:"source"`
	CheckEvery   string  `json:"check_every,omitempty"`
	CheckTimeout string  `json:"check_timeout,omitempty"`
	Tags         Tags    `json:"tags,omitempty"`
	Version      Version `json:"version,omitempty"`
	Icon         string  `json:"icon,omitempty"`
}

type ResourceConfigs ¶

type ResourceConfigs []ResourceConfig

func (ResourceConfigs) Lookup ¶

func (resources ResourceConfigs) Lookup(name string) (ResourceConfig, bool)

type ResourceIndex ¶

type ResourceIndex ResourceConfigs

func (ResourceIndex) FindEquivalent ¶

func (index ResourceIndex) FindEquivalent(obj interface{}) (interface{}, bool)

func (ResourceIndex) Slice ¶

func (index ResourceIndex) Slice() []interface{}

type ResourceType ¶

type ResourceType struct {
	Name       string `json:"name"`
	Type       string `json:"type"`
	Source     Source `json:"source"`
	Defaults   Source `json:"defaults,omitempty"`
	Privileged bool   `json:"privileged,omitempty"`
	CheckEvery string `json:"check_every,omitempty"`
	Tags       Tags   `json:"tags,omitempty"`
	Params     Params `json:"params,omitempty"`
}

type ResourceTypeIndex ¶

type ResourceTypeIndex ResourceTypes

func (ResourceTypeIndex) FindEquivalent ¶

func (index ResourceTypeIndex) FindEquivalent(obj interface{}) (interface{}, bool)

func (ResourceTypeIndex) Slice ¶

func (index ResourceTypeIndex) Slice() []interface{}

type ResourceTypes ¶

type ResourceTypes []ResourceType

func (ResourceTypes) Lookup ¶

func (types ResourceTypes) Lookup(name string) (ResourceType, bool)

func (ResourceTypes) Without ¶

func (types ResourceTypes) Without(name string) ResourceTypes

type ResourceVersion ¶

type ResourceVersion struct {
	ID       int             `json:"id"`
	Metadata []MetadataField `json:"metadata,omitempty"`
	Version  Version         `json:"version"`
	Enabled  bool            `json:"enabled"`
}

type RetryPlan ¶

type RetryPlan []Plan

func (RetryPlan) Public ¶

func (plan RetryPlan) Public() *json.RawMessage

type RetryStep ¶

type RetryStep struct {
	Step     StepConfig `json:"-"`
	Attempts int        `json:"attempts"`
}

func (*RetryStep) Unwrap ¶

func (step *RetryStep) Unwrap() StepConfig

func (*RetryStep) Visit ¶

func (step *RetryStep) Visit(v StepVisitor) error

func (*RetryStep) Wrap ¶

func (step *RetryStep) Wrap(sub StepConfig)

type SaveConfigResponse ¶

type SaveConfigResponse struct {
	Errors   []string        `json:"errors,omitempty"`
	Warnings []ConfigWarning `json:"warnings,omitempty"`
}

type SetPinCommentRequestBody ¶

type SetPinCommentRequestBody struct {
	PinComment string `json:"pin_comment"`
}

type SetPipelinePlan ¶

type SetPipelinePlan struct {
	Name         string                 `json:"name"`
	File         string                 `json:"file"`
	Team         string                 `json:"team,omitempty"`
	Vars         map[string]interface{} `json:"vars,omitempty"`
	VarFiles     []string               `json:"var_files,omitempty"`
	InstanceVars map[string]interface{} `json:"instance_vars,omitempty"`
}

func (SetPipelinePlan) Public ¶

func (plan SetPipelinePlan) Public() *json.RawMessage

type SetPipelineStep ¶

type SetPipelineStep struct {
	Name         string       `json:"set_pipeline"`
	File         string       `json:"file,omitempty"`
	Team         string       `json:"team,omitempty"`
	Vars         Params       `json:"vars,omitempty"`
	VarFiles     []string     `json:"var_files,omitempty"`
	InstanceVars InstanceVars `json:"instance_vars,omitempty"`
}

func (*SetPipelineStep) Visit ¶

func (step *SetPipelineStep) Visit(v StepVisitor) error

type Source ¶

type Source map[string]interface{}

func FindBaseResourceTypeDefaults ¶

func FindBaseResourceTypeDefaults(name string) (Source, bool)

func (Source) MarshalJSON ¶

func (src Source) MarshalJSON() ([]byte, error)

func (Source) Merge ¶

func (src Source) Merge(other Source) Source

Merge returns a new Source that merged other into src. The original src is not updated.

type Step ¶

type Step struct {
	Config        StepConfig
	UnknownFields map[string]*json.RawMessage
}

Step is an "envelope" type, acting as a wrapper to handle the marshaling and unmarshaling of an underlying StepConfig.

func (Step) MarshalJSON ¶

func (step Step) MarshalJSON() ([]byte, error)

MarshalJSON marshals step configuration in multiple passes, looping and calling .Unwrap to marshal all nested steps into one big set of fields which is then marshalled and returned.

func (*Step) UnmarshalJSON ¶

func (step *Step) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals step configuration in multiple passes, determining precedence by the order of StepDetectors listed in the StepPrecedence variable.

First, the step data is unmarshalled into a map[string]*json.RawMessage. Next, UnmarshalJSON loops over StepPrecedence to determine the type of step.

For any StepDetector with a .Key field present in the map, .New is called to construct an empty StepConfig, and then json.Unmarshal is called on it to parse the data.

For step modifiers like `timeout:` and `attempts:` they eventuallly wrap a core step type (e.g. get, put, task etc.). Core step types do not wrap other steps.

When a core step type is encountered parsing stops and any remaining keys in rawStepConfig are considered invalid. This is how we stop someone from putting a `get` and `put` in the same step while still allowing valid step modifiers. This is also why step modifiers are listed first in StepPrecedence.

If no StepDetectors match, no step is parsed, ErrNoStepConfigured is returned.

type StepConfig ¶

type StepConfig interface {
	// Visit must call StepVisitor with the appropriate method corresponding to
	// this step type.
	//
	// When a new step type is added, the StepVisitor interface must be extended.
	// This allows the compiler to help us track down all the places where steps
	// must be handled type-by-type.
	Visit(StepVisitor) error
}

StepConfig is implemented by all step types.

type StepDetector ¶

type StepDetector struct {
	// Key is the field that, if present, indicates that the step is configured.
	Key string

	// If Key is present, New will be called to construct an empty StepConfig.
	New func() StepConfig
}

StepDetector is a simple structure used to detect whether a step type is configured.

type StepRecursor ¶

type StepRecursor struct {
	// OnTask will be invoked for any *TaskStep present in the StepConfig.
	OnTask func(*TaskStep) error

	// OnGet will be invoked for any *GetStep present in the StepConfig.
	OnGet func(*GetStep) error

	// OnPut will be invoked for any *PutStep present in the StepConfig.
	OnPut func(*PutStep) error

	// OnSetPipeline will be invoked for any *SetPipelineStep present in the StepConfig.
	OnSetPipeline func(*SetPipelineStep) error

	// OnLoadVar will be invoked for any *LoadVarStep present in the StepConfig.
	OnLoadVar func(*LoadVarStep) error
}

StepRecursor is a StepVisitor helper used for traversing a StepConfig and calling configured hooks on the "base" step types, i.e. step types that do not contain any other steps.

StepRecursor must be updated with any new step type added. Steps which wrap other steps must recurse through them, while steps which are "base" steps must have a hook added for them, called when they visit the StepRecursor.

func (StepRecursor) VisitAcross ¶

func (recursor StepRecursor) VisitAcross(step *AcrossStep) error

VisitAcross recurses through to the wrapped step.

func (StepRecursor) VisitAggregate ¶

func (recursor StepRecursor) VisitAggregate(step *AggregateStep) error

VisitAggregate recurses through to the wrapped steps.

func (StepRecursor) VisitDo ¶

func (recursor StepRecursor) VisitDo(step *DoStep) error

VisitDo recurses through to the wrapped steps.

func (StepRecursor) VisitEnsure ¶

func (recursor StepRecursor) VisitEnsure(step *EnsureStep) error

VisitEnsure recurses through to the wrapped step and hook.

func (StepRecursor) VisitGet ¶

func (recursor StepRecursor) VisitGet(step *GetStep) error

VisitGet calls the OnGet hook if configured.

func (StepRecursor) VisitInParallel ¶

func (recursor StepRecursor) VisitInParallel(step *InParallelStep) error

VisitInParallel recurses through to the wrapped steps.

func (StepRecursor) VisitLoadVar ¶

func (recursor StepRecursor) VisitLoadVar(step *LoadVarStep) error

VisitLoadVar calls the OnLoadVar hook if configured.

func (StepRecursor) VisitOnAbort ¶

func (recursor StepRecursor) VisitOnAbort(step *OnAbortStep) error

VisitOnAbort recurses through to the wrapped step and hook.

func (StepRecursor) VisitOnError ¶

func (recursor StepRecursor) VisitOnError(step *OnErrorStep) error

VisitOnError recurses through to the wrapped step and hook.

func (StepRecursor) VisitOnFailure ¶

func (recursor StepRecursor) VisitOnFailure(step *OnFailureStep) error

VisitOnFailure recurses through to the wrapped step and hook.

func (StepRecursor) VisitOnSuccess ¶

func (recursor StepRecursor) VisitOnSuccess(step *OnSuccessStep) error

VisitOnSuccess recurses through to the wrapped step and hook.

func (StepRecursor) VisitPut ¶

func (recursor StepRecursor) VisitPut(step *PutStep) error

VisitPut calls the OnPut hook if configured.

func (StepRecursor) VisitRetry ¶

func (recursor StepRecursor) VisitRetry(step *RetryStep) error

VisitRetry recurses through to the wrapped step.

func (StepRecursor) VisitSetPipeline ¶

func (recursor StepRecursor) VisitSetPipeline(step *SetPipelineStep) error

VisitSetPipeline calls the OnSetPipeline hook if configured.

func (StepRecursor) VisitTask ¶

func (recursor StepRecursor) VisitTask(step *TaskStep) error

VisitTask calls the OnTask hook if configured.

func (StepRecursor) VisitTimeout ¶

func (recursor StepRecursor) VisitTimeout(step *TimeoutStep) error

VisitTimeout recurses through to the wrapped step.

func (StepRecursor) VisitTry ¶

func (recursor StepRecursor) VisitTry(step *TryStep) error

VisitTry recurses through to the wrapped step.

type StepValidator ¶

type StepValidator struct {
	// Warnings is a slice of warning messages to show to the user, while still
	// allowing the pipeline to be configured. This is typically used for
	// deprecations.
	//
	// This field will be populated after visiting the step.
	Warnings []ConfigWarning

	// Errors is a slice of critical errors which will prevent configuring the
	// pipeline.
	//
	// This field will be populated after visiting the step.
	Errors []string
	// contains filtered or unexported fields
}

StepValidator is a StepVisitor which validates each step that visits it, collecting warnings and errors as it goes.

func NewStepValidator ¶

func NewStepValidator(config Config, context []string) *StepValidator

NewStepValidator is a constructor which initializes internal data.

The Config specified is used to validate the existence of resources and jobs referenced by steps.

The context argument contains the initial context used to annotate error and warning messages. For example, []string{"jobs(foo)", ".plan"} will result in errors like 'jobs(foo).plan.task(bar): blah blah'.

func (*StepValidator) Validate ¶

func (validator *StepValidator) Validate(step Step) error

func (*StepValidator) VisitAcross ¶

func (validator *StepValidator) VisitAcross(step *AcrossStep) error

func (*StepValidator) VisitAggregate ¶

func (validator *StepValidator) VisitAggregate(step *AggregateStep) error

func (*StepValidator) VisitDo ¶

func (validator *StepValidator) VisitDo(step *DoStep) error

func (*StepValidator) VisitEnsure ¶

func (validator *StepValidator) VisitEnsure(step *EnsureStep) error

func (*StepValidator) VisitGet ¶

func (validator *StepValidator) VisitGet(step *GetStep) error

func (*StepValidator) VisitInParallel ¶

func (validator *StepValidator) VisitInParallel(step *InParallelStep) error

func (*StepValidator) VisitLoadVar ¶

func (validator *StepValidator) VisitLoadVar(step *LoadVarStep) error

func (*StepValidator) VisitOnAbort ¶

func (validator *StepValidator) VisitOnAbort(step *OnAbortStep) error

func (*StepValidator) VisitOnError ¶

func (validator *StepValidator) VisitOnError(step *OnErrorStep) error

func (*StepValidator) VisitOnFailure ¶

func (validator *StepValidator) VisitOnFailure(step *OnFailureStep) error

func (*StepValidator) VisitOnSuccess ¶

func (validator *StepValidator) VisitOnSuccess(step *OnSuccessStep) error

func (*StepValidator) VisitPut ¶

func (validator *StepValidator) VisitPut(step *PutStep) error

func (*StepValidator) VisitRetry ¶

func (validator *StepValidator) VisitRetry(step *RetryStep) error

func (*StepValidator) VisitSetPipeline ¶

func (validator *StepValidator) VisitSetPipeline(step *SetPipelineStep) error

func (*StepValidator) VisitTask ¶

func (validator *StepValidator) VisitTask(plan *TaskStep) error

func (*StepValidator) VisitTimeout ¶

func (validator *StepValidator) VisitTimeout(step *TimeoutStep) error

func (*StepValidator) VisitTry ¶

func (validator *StepValidator) VisitTry(step *TryStep) error

type StepVisitor ¶

type StepVisitor interface {
	VisitTask(*TaskStep) error
	VisitGet(*GetStep) error
	VisitPut(*PutStep) error
	VisitSetPipeline(*SetPipelineStep) error
	VisitLoadVar(*LoadVarStep) error
	VisitTry(*TryStep) error
	VisitDo(*DoStep) error
	VisitInParallel(*InParallelStep) error
	VisitAggregate(*AggregateStep) error
	VisitAcross(*AcrossStep) error
	VisitTimeout(*TimeoutStep) error
	VisitRetry(*RetryStep) error
	VisitOnSuccess(*OnSuccessStep) error
	VisitOnFailure(*OnFailureStep) error
	VisitOnAbort(*OnAbortStep) error
	VisitOnError(*OnErrorStep) error
	VisitEnsure(*EnsureStep) error
}

StepVisitor is an interface used to assist in finding all the places that need to be updated whenever a new step type is introduced.

Each StepConfig must implement .Visit to call the appropriate method on the given StepVisitor.

type StepWrapper ¶

type StepWrapper interface {
	// Wrap is called during (Step).UnmarshalJSON whenever an 'inner' step is
	// parsed.
	//
	// Modifier step types should implement this function by assigning the
	// passed in StepConfig to an internal field that has a `json:"-"` tag.
	Wrap(StepConfig)

	// Unwrap is called during (Step).MarshalJSON and must return the wrapped
	// StepConfig.
	Unwrap() StepConfig
}

StepWrapper is an optional interface for step types that is implemented by steps that wrap/modify other steps (e.g. hooks like `on_success`, `timeout`, etc.)

type Tags ¶

type Tags []string

type TaskCacheConfig ¶

type TaskCacheConfig struct {
	Path string `json:"path,omitempty"`
}

type TaskConfig ¶

type TaskConfig struct {
	// The platform the task must run on (e.g. linux, windows).
	Platform string `json:"platform,omitempty"`

	// Optional string specifying an image to use for the build. Depending on the
	// platform, this may or may not be required (e.g. Windows/OS X vs. Linux).
	RootfsURI string `json:"rootfs_uri,omitempty"`

	ImageResource *ImageResource `json:"image_resource,omitempty"`

	// Limits to set on the Task Container
	Limits *ContainerLimits `json:"container_limits,omitempty"`

	// Parameters to pass to the task via environment variables.
	Params TaskEnv `json:"params,omitempty"`

	// Script to execute.
	Run TaskRunConfig `json:"run,omitempty"`

	// The set of (logical, name-only) inputs required by the task.
	Inputs []TaskInputConfig `json:"inputs,omitempty"`

	// The set of (logical, name-only) outputs provided by the task.
	Outputs []TaskOutputConfig `json:"outputs,omitempty"`

	// Path to cached directory that will be shared between builds for the same task.
	Caches []TaskCacheConfig `json:"caches,omitempty"`
}

func NewTaskConfig ¶

func NewTaskConfig(configBytes []byte) (TaskConfig, error)

func (TaskConfig) Validate ¶

func (config TaskConfig) Validate() error

type TaskEnv ¶

type TaskEnv map[string]string

func (TaskEnv) Env ¶

func (te TaskEnv) Env() []string

func (*TaskEnv) UnmarshalJSON ¶

func (te *TaskEnv) UnmarshalJSON(p []byte) error

type TaskInputConfig ¶

type TaskInputConfig struct {
	Name     string `json:"name"`
	Path     string `json:"path,omitempty"`
	Optional bool   `json:"optional,omitempty"`
}

type TaskOutputConfig ¶

type TaskOutputConfig struct {
	Name string `json:"name"`
	Path string `json:"path,omitempty"`
}

type TaskPlan ¶

type TaskPlan struct {
	// The name of the step.
	Name string `json:"name"`

	// Run the task in 'privileged' mode. What this means depends on the
	// platform, but typically you expose your workers to more risk by enabling
	// this.
	Privileged bool `json:"privileged"`

	// Worker tags to influence placement of the container.
	Tags Tags `json:"tags,omitempty"`

	// The task config to execute - either fetched from a path at runtime, or
	// provided statically.
	ConfigPath string      `json:"config_path,omitempty"`
	Config     *TaskConfig `json:"config,omitempty"`

	// An artifact in the build plan to use as the task's image. Overrides any
	// image set in the task's config.
	ImageArtifactName string `json:"image,omitempty"`

	// Vars to use to parameterize the task config.
	Vars Params `json:"vars,omitempty"`

	// Params to set in the task's environment.
	Params TaskEnv `json:"params,omitempty"`

	// Remap inputs and output artifacts from task names to other names in the
	// build plan.
	InputMapping  map[string]string `json:"input_mapping,omitempty"`
	OutputMapping map[string]string `json:"output_mapping,omitempty"`

	// Resource types to have available for use when fetching the task's image.
	//
	// XXX(check-refactor): Eliminating this would be great - if we can replace
	// image fetching with a 'check' and 'get' step and then use
	// ImageArtifactName, we'll have everything going down one code path and we
	// can tidy up the runtime interface substantially. Unfortunately this is
	// difficult to do because we don't even know what image resource to fetch
	// until the task step runs and fetches its ConfigPath.
	VersionedResourceTypes VersionedResourceTypes `json:"resource_types,omitempty"`
}

func (TaskPlan) Public ¶

func (plan TaskPlan) Public() *json.RawMessage

type TaskRunConfig ¶

type TaskRunConfig struct {
	Path string   `json:"path"`
	Args []string `json:"args,omitempty"`
	Dir  string   `json:"dir,omitempty"`

	// The user that the task will run as (defaults to whatever the docker image specifies)
	User string `json:"user,omitempty"`
}

type TaskStep ¶

type TaskStep struct {
	Name              string            `json:"task"`
	Privileged        bool              `json:"privileged,omitempty"`
	ConfigPath        string            `json:"file,omitempty"`
	Config            *TaskConfig       `json:"config,omitempty"`
	Params            TaskEnv           `json:"params,omitempty"`
	Vars              Params            `json:"vars,omitempty"`
	Tags              Tags              `json:"tags,omitempty"`
	InputMapping      map[string]string `json:"input_mapping,omitempty"`
	OutputMapping     map[string]string `json:"output_mapping,omitempty"`
	ImageArtifactName string            `json:"image,omitempty"`
}

func (*TaskStep) Visit ¶

func (step *TaskStep) Visit(v StepVisitor) error

type TaskValidationError ¶

type TaskValidationError struct {
	Errors []string
}

func (TaskValidationError) Error ¶

func (err TaskValidationError) Error() string

type Team ¶

type Team struct {
	ID   int      `json:"id,omitempty"`
	Name string   `json:"name,omitempty"`
	Auth TeamAuth `json:"auth,omitempty"`
}

func (Team) Validate ¶

func (team Team) Validate() error

type TeamAuth ¶

type TeamAuth map[string]map[string][]string

func (TeamAuth) Validate ¶

func (auth TeamAuth) Validate() error

type TimeoutPlan ¶

type TimeoutPlan struct {
	Step     Plan   `json:"step"`
	Duration string `json:"duration"`
}

func (TimeoutPlan) Public ¶

func (plan TimeoutPlan) Public() *json.RawMessage

type TimeoutStep ¶

type TimeoutStep struct {
	Step StepConfig `json:"-"`

	// it's very tempting to make this a Duration type, but that would probably
	// prevent using `((vars))` to parameterize it
	Duration string `json:"timeout"`
}

func (*TimeoutStep) Unwrap ¶

func (step *TimeoutStep) Unwrap() StepConfig

func (*TimeoutStep) Visit ¶

func (step *TimeoutStep) Visit(v StepVisitor) error

func (*TimeoutStep) Wrap ¶

func (step *TimeoutStep) Wrap(sub StepConfig)

type TryPlan ¶

type TryPlan struct {
	Step Plan `json:"step"`
}

func (TryPlan) Public ¶

func (plan TryPlan) Public() *json.RawMessage

type TryStep ¶

type TryStep struct {
	Step Step `json:"try"`
}

func (*TryStep) Visit ¶

func (step *TryStep) Visit(v StepVisitor) error

type User ¶

type User struct {
	ID        int    `json:"id,omitempty"`
	Username  string `json:"username,omitempty"`
	Connector string `json:"connector,omitempty"`
	LastLogin int64  `json:"last_login,omitempty"`
	Sub       string `json:"sub,omitempty"`
}

type UserInfo ¶

type UserInfo struct {
	Sub      string              `json:"sub"`
	Name     string              `json:"name"`
	UserId   string              `json:"user_id"`
	UserName string              `json:"user_name"`
	Email    string              `json:"email"`
	IsAdmin  bool                `json:"is_admin"`
	IsSystem bool                `json:"is_system"`
	Teams    map[string][]string `json:"teams"`
}

type VarScopedPlan ¶

type VarScopedPlan struct {
	Step   Plan          `json:"step"`
	Values []interface{} `json:"values"`
}

type VarSourceConfig ¶

type VarSourceConfig struct {
	Name   string      `json:"name"`
	Type   string      `json:"type"`
	Config interface{} `json:"config"`
}

type VarSourceConfigs ¶

type VarSourceConfigs []VarSourceConfig

func (VarSourceConfigs) Lookup ¶

func (c VarSourceConfigs) Lookup(name string) (VarSourceConfig, bool)

func (VarSourceConfigs) OrderByDependency ¶

func (c VarSourceConfigs) OrderByDependency() (VarSourceConfigs, error)

type VarSourceIndex ¶

type VarSourceIndex VarSourceConfigs

func (VarSourceIndex) FindEquivalent ¶

func (index VarSourceIndex) FindEquivalent(obj interface{}) (interface{}, bool)

func (VarSourceIndex) Slice ¶

func (index VarSourceIndex) Slice() []interface{}

type Version ¶

type Version map[string]string

type VersionConfig ¶

type VersionConfig struct {
	Every  bool
	Latest bool
	Pinned Version
}

A VersionConfig represents the choice to include every version of a resource, the latest version of a resource, or a pinned (specific) one.

func (*VersionConfig) MarshalJSON ¶

func (c *VersionConfig) MarshalJSON() ([]byte, error)

func (*VersionConfig) UnmarshalJSON ¶

func (c *VersionConfig) UnmarshalJSON(version []byte) error

type VersionedResourceType ¶

type VersionedResourceType struct {
	ResourceType

	Version Version `json:"version"`
}

type VersionedResourceTypes ¶

type VersionedResourceTypes []VersionedResourceType

func (VersionedResourceTypes) Base ¶

func (types VersionedResourceTypes) Base(name string) string

func (VersionedResourceTypes) Lookup ¶

func (VersionedResourceTypes) Without ¶

type Volume ¶

type Volume struct {
	ID                   string                  `json:"id"`
	WorkerName           string                  `json:"worker_name"`
	Type                 string                  `json:"type"`
	ContainerHandle      string                  `json:"container_handle"`
	Path                 string                  `json:"path"`
	ParentHandle         string                  `json:"parent_handle"`
	ResourceType         *VolumeResourceType     `json:"resource_type"`
	BaseResourceType     *VolumeBaseResourceType `json:"base_resource_type"`
	PipelineID           int                     `json:"pipeline_id"`
	PipelineName         string                  `json:"pipeline_name"`
	PipelineInstanceVars InstanceVars            `json:"pipeline_instance_vars"`
	JobName              string                  `json:"job_name"`
	StepName             string                  `json:"step_name"`
}

type VolumeBaseResourceType ¶

type VolumeBaseResourceType struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type VolumeResourceType ¶

type VolumeResourceType struct {
	ResourceType     *VolumeResourceType     `json:"resource_type"`
	BaseResourceType *VolumeBaseResourceType `json:"base_resource_type"`
	Version          Version                 `json:"version"`
}

type Wall ¶

type Wall struct {
	Message string        `json:"message,omitempty"`
	TTL     time.Duration `json:"TTL,omitempty"`
}

type Worker ¶

type Worker struct {
	// not garden_addr, for backwards-compatibility
	GardenAddr      string `json:"addr"`
	BaggageclaimURL string `json:"baggageclaim_url"`

	CertsPath *string `json:"certs_path,omitempty"`

	HTTPProxyURL  string `json:"http_proxy_url,omitempty"`
	HTTPSProxyURL string `json:"https_proxy_url,omitempty"`
	NoProxy       string `json:"no_proxy,omitempty"`

	ActiveContainers int `json:"active_containers"`
	ActiveVolumes    int `json:"active_volumes"`
	ActiveTasks      int `json:"active_tasks"`

	ResourceTypes []WorkerResourceType `json:"resource_types"`

	Platform  string   `json:"platform"`
	Tags      []string `json:"tags"`
	Team      string   `json:"team"`
	Name      string   `json:"name"`
	Version   string   `json:"version"`
	StartTime int64    `json:"start_time"`
	Ephemeral bool     `json:"ephemeral"`
	State     string   `json:"state"`
}

func (Worker) Validate ¶

func (w Worker) Validate() error

type WorkerArtifact ¶

type WorkerArtifact struct {
	ID        int    `json:"id"`
	Name      string `json:"name"`
	BuildID   int    `json:"build_id"`
	CreatedAt int64  `json:"created_at"`
}

TODO-L Can this be consolidated with atc/runtime/types.go -> Artifact

type WorkerResourceType ¶

type WorkerResourceType struct {
	Type                 string `json:"type"`
	Image                string `json:"image"`
	Version              string `json:"version"`
	Privileged           bool   `json:"privileged"`
	UniqueVersionHistory bool   `json:"unique_version_history"`
}

Directories ¶

Path Synopsis
api
accessor/accessorfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
auth/authfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
containerserver/containerserverfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
pipelineserver/pipelineserverfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
policychecker/policycheckerfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
auditorfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
cmd
atc
compressionfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
credsfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
ssm
db
dbfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
encryption/encryptionfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
lock/lockfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
migration/migrationfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
enginefakes
Code generated by counterfeiter.
Code generated by counterfeiter.
build/buildfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
execfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
gc
gcfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
emitter/emitterfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
metricfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
opa
policyfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
resourcefakes
Code generated by counterfeiter.
Code generated by counterfeiter.
runtimefakes
Code generated by counterfeiter.
Code generated by counterfeiter.
schedulerfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
syslogfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
Package worker will eventually evolve to becoming a concrete implementation of a runtime As such, Concourse core shouldn't depend on abstractions defined in this package or its child packages General Runtime abstractions will be ported over to the Runtime package The Client interface is the main interface that is consumed by Concourse core that will be shifted to the Runtime package
Package worker will eventually evolve to becoming a concrete implementation of a runtime As such, Concourse core shouldn't depend on abstractions defined in this package or its child packages General Runtime abstractions will be ported over to the Runtime package The Client interface is the main interface that is consumed by Concourse core that will be shifted to the Runtime package
gclient/connection/connectionfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
gclient/gclientfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
transport/transportfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
workerfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
wrappafakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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