Documentation
¶
Index ¶
- Constants
- Variables
- func EmptyEnv() *util.Environment
- func GenerateBaseKey(options *PipelineOptions) string
- func IsBuildID(input string) bool
- func NewEmitterContext(ctx context.Context) context.Context
- func ParseApplicationID(input string) (username, name string, err error)
- func ReadWerckerYaml(searchDirs []string, allowDefault bool) ([]byte, error)
- type AWSOptions
- type Artifact
- type BasePipeline
- func (p *BasePipeline) AfterSteps() []Step
- func (p *BasePipeline) Box() Box
- func (p *BasePipeline) CommonEnv() [][]string
- func (p *BasePipeline) Docker() bool
- func (p *BasePipeline) Env() *util.Environment
- func (p *BasePipeline) ExportEnvironment(sessionCtx context.Context, sess *Session) error
- func (p *BasePipeline) LogEnvironment()
- func (p *BasePipeline) Services() []ServiceBox
- func (p *BasePipeline) SetupGuest(sessionCtx context.Context, sess *Session) error
- func (p *BasePipeline) Steps() []Step
- func (p *BasePipeline) SyncEnvironment(sessionCtx context.Context, sess *Session) error
- type BasePipelineOptions
- type BaseStep
- func (s *BaseStep) Checkpoint() string
- func (s *BaseStep) Clean()
- func (s *BaseStep) Cwd() string
- func (s *BaseStep) DisplayName() string
- func (s *BaseStep) Env() *util.Environment
- func (s *BaseStep) ID() string
- func (s *BaseStep) Name() string
- func (s *BaseStep) Owner() string
- func (s *BaseStep) SafeID() string
- func (s *BaseStep) Version() string
- type BaseStepOptions
- type Box
- type BoxConfig
- type BoxOptions
- type BuildFinishedArgs
- type BuildStartedArgs
- type BuildStepFinishedArgs
- type BuildStepStartedArgs
- type BuildStepsAddedArgs
- type CommandResult
- type Config
- type DebugHandler
- type DetectOptions
- type ExternalStep
- func (s *ExternalStep) CachedName() string
- func (s *ExternalStep) CollectArtifact(ctx context.Context, containerID string) (*Artifact, error)
- func (s *ExternalStep) CollectFile(containerID, path, name string, dst io.Writer) error
- func (s *ExternalStep) Execute(sessionCtx context.Context, sess *Session) (int, error)
- func (s *ExternalStep) Fetch() (string, error)
- func (s *ExternalStep) FetchScript() (string, error)
- func (s *ExternalStep) GuestPath(p ...string) string
- func (s *ExternalStep) HostPath(p ...string) string
- func (s *ExternalStep) InitEnv(ctx context.Context, env *util.Environment) error
- func (s *ExternalStep) IsScript() bool
- func (s *ExternalStep) LocalSymlink()
- func (s *ExternalStep) MntPath(p ...string) string
- func (s *ExternalStep) ReportPath(p ...string) string
- func (s *ExternalStep) SetupGuest(sessionCtx context.Context, sess *Session) error
- func (s *ExternalStep) ShouldSyncEnv() bool
- type FileCollector
- type FileStore
- type FullPipelineFinishedArgs
- type GitOptions
- type GlobalOptions
- type InspectOptions
- type LoginOptions
- type LogoutOptions
- type LogsArgs
- type NormalizedEmitter
- type OCIOptions
- type ObjectStore
- type Pipeline
- type PipelineConfig
- type PipelineDefaultsUsed
- type PipelineOptions
- func EmptyPipelineOptions() *PipelineOptions
- func NewBuildOptions(c util.Settings, e *util.Environment) (*PipelineOptions, error)
- func NewCheckConfigOptions(c util.Settings, e *util.Environment) (*PipelineOptions, error)
- func NewDeployOptions(c util.Settings, e *util.Environment) (*PipelineOptions, error)
- func NewDevOptions(c util.Settings, e *util.Environment) (*PipelineOptions, error)
- func NewPipelineOptions(c util.Settings, e *util.Environment) (*PipelineOptions, error)
- func (o *PipelineOptions) BasePath() string
- func (o *PipelineOptions) BuildPath(s ...string) string
- func (o *PipelineOptions) CachePath() string
- func (o *PipelineOptions) ContainerPath() string
- func (o *PipelineOptions) GuestPath(s ...string) string
- func (o *PipelineOptions) HostPath(s ...string) string
- func (o *PipelineOptions) IgnoreFilePath() string
- func (o *PipelineOptions) MntPath(s ...string) string
- func (o *PipelineOptions) ProjectDownloadPath() string
- func (o *PipelineOptions) ReportPath(s ...string) string
- func (o *PipelineOptions) SourcePath() string
- func (o *PipelineOptions) StepPath() string
- func (o *PipelineOptions) WorkflowURL() string
- func (o *PipelineOptions) WorkingPath(s ...string) string
- type PipelineResult
- type PullOptions
- type RawBoxConfig
- type RawConfig
- type RawPipelineConfig
- type RawStepConfig
- type RawStepsConfig
- type Receiver
- type ReporterOptions
- type S3Store
- type Sender
- type ServiceBox
- type Session
- func (s *Session) Attach(runnerCtx context.Context) (context.Context, error)
- func (s *Session) HideLogs()
- func (s *Session) Recv() chan string
- func (s *Session) Send(sessionCtx context.Context, forceHidden bool, commands ...string) error
- func (s *Session) SendChecked(sessionCtx context.Context, commands ...string) (int, []string, error)
- func (s *Session) ShowLogs()
- func (s *Session) Transport() interface{}
- type Step
- type StepConfig
- type StepDesc
- type StepDescProperty
- type Store
- type StoreFromFileArgs
- type Transport
- type VersionOptions
- type WerckerDockerOptions
- type WerckerRunnerOptions
- type WerckerStepOptions
- type WorkflowConfig
- type WorkflowOptions
- type WorkflowPipelineConfig
Constants ¶
const ( // Logs is the event when wercker generate logs Logs = "Logs" // BuildStarted is the event when wercker has started a build. BuildStarted = "BuildStarted" // BuildFinished occures when a pipeline finishes the main phase. It is // possible that after-steps are run after this event. BuildFinished = "BuildFinished" // BuildStepsAdded is the event when wercker has parsed the wercker.yml and // has valdiated that the steps exist. BuildStepsAdded = "BuildStepsAdded" // BuildStepStarted is the event when wercker has started a new buildstep. BuildStepStarted = "BuildStepStarted" // BuildStepFinished is the event when wercker has finished a buildstep. BuildStepFinished = "BuildStepFinished" // FullPipelineFinished occurs when a pipeline finishes all it's steps, // included after-steps. FullPipelineFinished = "FullPipelineFinished" )
const FingerPrintVarName = "FINGERPRINT"
const OCI_BUCKET = "oci-bucket"
const OCI_FINGERPRINT = "oci-fingerprint"
const OCI_NAMESPACE = "oci-namespace"
const OCI_PRIVATE_KEY_PASSPHRASE = "oci-private-key-passphrase"
const OCI_PRIVATE_KEY_PATH = "oci-private-key-path"
const OCI_REGION = "oci-region"
const OCI_TENANCY_OCID = "oci-tenancy-ocid"
OCI flags
const OCI_USER_OCID = "oci-user-ocid"
const OciEnvVarPrefix = "WERCKER_OCI_"
OciEnvVarPrefix is the prefix to use for all environment variables needed by the OCI API
const PrivateKeyPassphraseVarName = "PRIVATE_KEY_PASSPHRASE"
const PrivateKeyVarName = "PRIVATE_KEY_PATH"
const RegionVarName = "REGION"
const TenancyVarName = "TENANCY_OCID"
const UserVarName = "USER_OCID"
Variables ¶
var ( DEFAULT_BASE_URL = "https://app.wercker.com" DEFAULT_STEP_REGISTRY = "https://steps.wercker.com" )
Functions ¶
func EmptyEnv ¶
func EmptyEnv() *util.Environment
func GenerateBaseKey ¶
func GenerateBaseKey(options *PipelineOptions) string
GenerateBaseKey generates the base key based on ApplicationID and either DeployID or BuilID
func IsBuildID ¶
IsBuildID checks if input is a BuildID. BuildID is defined as a 24 character hex string.
func NewEmitterContext ¶
NewEmitterContext gives us a new context with an emitter
func ParseApplicationID ¶
ParseApplicationID parses input and returns the username and application name. A valid application ID is two strings separated by a /.
Types ¶
type AWSOptions ¶
type AWSOptions struct { *GlobalOptions AWSAccessKeyID string AWSSecretAccessKey string AWSRegion string S3Bucket string S3PartSize int64 }
AWSOptions for our artifact storage
func NewAWSOptions ¶
func NewAWSOptions(c util.Settings, e *util.Environment, globalOpts *GlobalOptions) (*AWSOptions, error)
NewAWSOptions constructor
type Artifact ¶
type Artifact struct { ContainerID string GuestPath string HostTarPath string HostPath string ApplicationID string RunID string RunStepID string Bucket string Key string ContentType string Meta map[string]*string }
Artifact holds the information required to extract a folder from a container and eventually upload it to S3.
func (*Artifact) RemotePath ¶
RemotePath returns the S3 path for an artifact
type BasePipeline ¶
type BasePipeline struct {
// contains filtered or unexported fields
}
BasePipeline is the base class for Build and Deploy
func NewBasePipeline ¶
func NewBasePipeline(args BasePipelineOptions) *BasePipeline
func (*BasePipeline) AfterSteps ¶
func (p *BasePipeline) AfterSteps() []Step
AfterSteps is a getter for afterSteps
func (*BasePipeline) CommonEnv ¶
func (p *BasePipeline) CommonEnv() [][]string
CommonEnv is shared by both builds and deploys
func (*BasePipeline) Docker ¶
func (p *BasePipeline) Docker() bool
Docker - returns true if the build requires a Remote Docker Daemon
func (*BasePipeline) ExportEnvironment ¶
func (p *BasePipeline) ExportEnvironment(sessionCtx context.Context, sess *Session) error
ExportEnvironment to the session
func (*BasePipeline) LogEnvironment ¶
func (p *BasePipeline) LogEnvironment()
LogEnvironment dumps the base environment
func (*BasePipeline) Services ¶
func (p *BasePipeline) Services() []ServiceBox
Services is a getter for the Services
func (*BasePipeline) SetupGuest ¶
func (p *BasePipeline) SetupGuest(sessionCtx context.Context, sess *Session) error
SetupGuest ensures that the guest is prepared to run the pipeline.
func (*BasePipeline) SyncEnvironment ¶
func (p *BasePipeline) SyncEnvironment(sessionCtx context.Context, sess *Session) error
SyncEnvironment fetches the current environment from sess, and merges the result with p.env. This requires the `env` command to be available on the container.
type BasePipelineOptions ¶
type BasePipelineOptions struct { Options *PipelineOptions Config *PipelineConfig Env *util.Environment Box Box Services []ServiceBox Steps []Step AfterSteps []Step Logger *util.LogEntry }
type BaseStep ¶
type BaseStep struct {
// contains filtered or unexported fields
}
BaseStep type for extending
func NewBaseStep ¶
func NewBaseStep(args BaseStepOptions) *BaseStep
type BaseStepOptions ¶
type BaseStepOptions struct { DisplayName string Env *util.Environment ID string Name string Owner string SafeID string Version string Cwd string Checkpoint string }
BaseStepOptions are exported fields so that we can make a BaseStep from other packages, see: https://gist.github.com/termie/8b66a2b4206e8e042766
type Box ¶
type Box interface { GetName() string GetTag() string Repository() string Clean() error Stop() Commit(string, string, string, bool) (*docker.Image, error) Restart() (*docker.Container, error) AddService(ServiceBox) Fetch(context.Context, *util.Environment) (*docker.Image, error) Run(context.Context, *util.Environment, string) (*docker.Container, error) RecoverInteractive(string, Pipeline, Step) error }
type BoxConfig ¶
type BoxConfig struct { ID string Name string Tag string Cmd string Env map[string]string Ports []string Entrypoint string URL string Volumes string Auth dockerauth.CheckAccessOptions `yaml:",inline"` }
BoxConfig is the type for boxes in the config
func (*BoxConfig) IsExternal ¶
IsExternal tells us if the box (service) is located on disk
type BuildFinishedArgs ¶
type BuildFinishedArgs struct { Box Box Options *PipelineOptions Result string }
BuildFinishedArgs contains the args associated with the "BuildFinished" event.
type BuildStartedArgs ¶
type BuildStartedArgs struct {
Options *PipelineOptions
}
BuildStartedArgs contains the args associated with the "BuildStarted" event.
type BuildStepFinishedArgs ¶
type BuildStepFinishedArgs struct { Options *PipelineOptions Box Box Build Pipeline Order int Step Step Successful bool Message string ArtifactURL string // Only applicable to the store step PackageURL string // Only applicable to the setup environment step WerckerYamlContents string }
BuildStepFinishedArgs contains the args associated with the "BuildStepFinished" event.
type BuildStepStartedArgs ¶
type BuildStepStartedArgs struct { Options *PipelineOptions Box Box Build Pipeline Order int Step Step }
BuildStepStartedArgs contains the args associated with the "BuildStepStarted" event.
type BuildStepsAddedArgs ¶
type BuildStepsAddedArgs struct { Build Pipeline Options *PipelineOptions Steps []Step StoreStep Step AfterSteps []Step }
BuildStepsAddedArgs contains the args associated with the "BuildStepsAdded" event.
type CommandResult ¶
type CommandResult struct {
// contains filtered or unexported fields
}
CommandResult exists so that we can make a channel of them
type Config ¶
type Config struct { Box *RawBoxConfig `yaml:"box"` CommandTimeout int `yaml:"command-timeout"` NoResponseTimeout int `yaml:"no-response-timeout"` Services []*RawBoxConfig `yaml:"services"` SourceDir string `yaml:"source-dir"` IgnoreFile string `yaml:"ignore-file"` PipelinesMap map[string]*RawPipelineConfig Workflows []*WorkflowConfig `yaml:"workflows"` }
Config is the data type for wercker.yml
func ConfigFromYaml ¶
ConfigFromYaml reads a []byte as yaml and turn it into a Config object
func (*Config) GetWorkflow ¶
func (c *Config) GetWorkflow(name string) *WorkflowConfig
GetWorkflow returns the workflow by name.
func (*Config) ValidateWorkflows ¶
ValidateWorkflows validates every workflow in the config.
type DebugHandler ¶
type DebugHandler struct {
// contains filtered or unexported fields
}
DebugHandler dumps events
func (*DebugHandler) Handler ¶
func (h *DebugHandler) Handler(name string) func(interface{})
Handler returns a per-event dumpEvent
func (*DebugHandler) ListenTo ¶
func (h *DebugHandler) ListenTo(e *NormalizedEmitter)
ListenTo attaches to the emitter
type DetectOptions ¶
type DetectOptions struct {
*GlobalOptions
}
DetectOptions for detect command
func NewDetectOptions ¶
func NewDetectOptions(c util.Settings, e *util.Environment) (*DetectOptions, error)
NewDetectOptions constructor
type ExternalStep ¶
type ExternalStep struct { *BaseStep // contains filtered or unexported fields }
ExternalStep is the holder of the Step methods.
func NewStep ¶
func NewStep(stepConfig *StepConfig, options *PipelineOptions) (*ExternalStep, error)
NewStep sets up the basic parts of a Step. Step names can come in a couple forms (x means currently supported):
x setup-go-environment (fetches from api) x wercker/hipchat-notify (fetches from api) x wercker/hipchat-notify "http://someurl/thingee.tar" (downloads tarball) x setup-go-environment "file:///some_path" (uses local path)
func NewWerckerInitStep ¶
func NewWerckerInitStep(options *PipelineOptions) (*ExternalStep, error)
NewWerckerInitStep returns our fake initial step
func (*ExternalStep) CachedName ¶
func (s *ExternalStep) CachedName() string
CachedName returns a name suitable for caching
func (*ExternalStep) CollectArtifact ¶
CollectArtifact noop
func (*ExternalStep) CollectFile ¶
func (s *ExternalStep) CollectFile(containerID, path, name string, dst io.Writer) error
CollectFile noop
func (*ExternalStep) Fetch ¶
func (s *ExternalStep) Fetch() (string, error)
Fetch grabs the Step content (or calls FetchScript for script steps).
func (*ExternalStep) FetchScript ¶
func (s *ExternalStep) FetchScript() (string, error)
FetchScript turns the raw code in a step into a shell file.
func (*ExternalStep) GuestPath ¶
func (s *ExternalStep) GuestPath(p ...string) string
GuestPath returns a path relative to the Step on the guest.
func (*ExternalStep) HostPath ¶
func (s *ExternalStep) HostPath(p ...string) string
HostPath returns a path relative to the Step on the host.
func (*ExternalStep) InitEnv ¶
func (s *ExternalStep) InitEnv(ctx context.Context, env *util.Environment) error
InitEnv sets up the internal environment for the Step.
func (*ExternalStep) IsScript ¶
func (s *ExternalStep) IsScript() bool
IsScript should probably not be exported.
func (*ExternalStep) LocalSymlink ¶
func (s *ExternalStep) LocalSymlink()
LocalSymlink makes sure we have an easy to use local symlink
func (*ExternalStep) MntPath ¶
func (s *ExternalStep) MntPath(p ...string) string
MntPath returns a path relative to the read-only mount of the Step on the guest.
func (*ExternalStep) ReportPath ¶
func (s *ExternalStep) ReportPath(p ...string) string
ReportPath returns a path to the reports for the step on the guest.
func (*ExternalStep) SetupGuest ¶
func (s *ExternalStep) SetupGuest(sessionCtx context.Context, sess *Session) error
SetupGuest ensures that the guest is ready to run a Step.
func (*ExternalStep) ShouldSyncEnv ¶
func (s *ExternalStep) ShouldSyncEnv() bool
ShouldSyncEnv before this step, default FALSE
type FileCollector ¶
FileCollector gets files out of containers
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
FileStore stores files on the local file system
func NewFileStore ¶
func NewFileStore(options *PipelineOptions, storepath string) *FileStore
NewFileStore creates a new FileStore
func (*FileStore) StoreFromFile ¶
func (s *FileStore) StoreFromFile(args *StoreFromFileArgs) error
StoreFromFile copies the file from args.Path to options.Bucket + args.Key.
type FullPipelineFinishedArgs ¶
type FullPipelineFinishedArgs struct { Options *PipelineOptions MainSuccessful bool RanAfterSteps bool AfterStepSuccessful bool }
FullPipelineFinishedArgs contains the args associated with the "FullPipelineFinished" event.
type GitOptions ¶
type GitOptions struct { *GlobalOptions GitBranch string GitTag string GitCommit string GitDomain string GitOwner string GitRepository string }
GitOptions for the users, mostly
func NewGitOptions ¶
func NewGitOptions(c util.Settings, e *util.Environment, globalOpts *GlobalOptions) (*GitOptions, error)
NewGitOptions constructor
type GlobalOptions ¶
type GlobalOptions struct { BaseURL string StepRegistryURL string Debug bool Verbose bool ShowColors bool // Auth AuthToken string AuthTokenStore string // local-file-store LocalFileStore string }
GlobalOptions applicable to everything
func NewGlobalOptions ¶
func NewGlobalOptions(c util.Settings, e *util.Environment) (*GlobalOptions, error)
NewGlobalOptions constructor
type InspectOptions ¶
type InspectOptions struct {
*PipelineOptions
}
InspectOptions for inspect command
func NewInspectOptions ¶
func NewInspectOptions(c util.Settings, e *util.Environment) (*InspectOptions, error)
NewInspectOptions constructor
type LoginOptions ¶
type LoginOptions struct {
*GlobalOptions
}
LoginOptions for the login command
func NewLoginOptions ¶
func NewLoginOptions(c util.Settings, e *util.Environment) (*LoginOptions, error)
NewLoginOptions constructor
type LogoutOptions ¶
type LogoutOptions struct {
*GlobalOptions
}
LogoutOptions for the login command
func NewLogoutOptions ¶
func NewLogoutOptions(c util.Settings, e *util.Environment) (*LogoutOptions, error)
NewLogoutOptions constructor
type LogsArgs ¶
type LogsArgs struct { Build Pipeline Options *PipelineOptions Order int Step Step Logs string Stream string Hidden bool }
LogsArgs contains the args associated with the "Logs" event.
type NormalizedEmitter ¶
NormalizedEmitter wraps the emission.Emitter and is smart enough about our events to fill in details as needed so that we don't need so many args
func EmitterFromContext ¶
func EmitterFromContext(ctx context.Context) (e *NormalizedEmitter, err error)
EmitterFromContext gives us the emitter attached to the context
func NewNormalizedEmitter ¶
func NewNormalizedEmitter() *NormalizedEmitter
NewNormalizedEmitter constructor
func (*NormalizedEmitter) Emit ¶
func (e *NormalizedEmitter) Emit(event interface{}, args interface{})
Emit normalizes our events by storing some state
type OCIOptions ¶
type OCIOptions struct { *GlobalOptions TenancyOCID string UserOCID string Region string PrivateKeyPath string PrivateKeyPassphrase string Fingerprint string Namespace string Bucket string ObjectName string LocalPath string TarBX bool }
OCIOptions for OCI Object Store
func NewOCIOptions ¶
func NewOCIOptions(c util.Settings, e *util.Environment, globalOpts *GlobalOptions) (*OCIOptions, error)
NewOCIOptions constructor
type ObjectStore ¶
type ObjectStore struct {
// contains filtered or unexported fields
}
ObjectStore stores files in OCI Object Store
func NewObjectStore ¶
func NewObjectStore(options *OCIOptions) *ObjectStore
NewObjectStore creates a new OCI Object Store
func (*ObjectStore) StoreFromFile ¶
func (s *ObjectStore) StoreFromFile(args *StoreFromFileArgs) error
StoreFromFile copies the file from args.Path to options.Bucket + args.Key.
type Pipeline ¶
type Pipeline interface { // Getters Env() *util.Environment // base Box() Box // base Services() []ServiceBox //base Steps() []Step // base AfterSteps() []Step // base // Methods CommonEnv() [][]string // base InitEnv(context.Context, *util.Environment) // impl CollectArtifact(context.Context, string) (*Artifact, error) CollectCache(context.Context, string) error LocalSymlink() SetupGuest(context.Context, *Session) error ExportEnvironment(context.Context, *Session) error SyncEnvironment(context.Context, *Session) error LogEnvironment() DockerRepo() string DockerTag() string DockerMessage() string //Docker() - returns true if the build requires a Remote Docker Daemon Docker() bool }
Pipeline is a set of steps to run, this is the interface shared by both Build and Deploy
type PipelineConfig ¶
type PipelineConfig struct { Box *RawBoxConfig Steps RawStepsConfig AfterSteps RawStepsConfig `yaml:"after-steps"` StepsMap map[string][]*RawStepConfig Services []*RawBoxConfig `yaml:"services"` BasePath string `yaml:"base-path"` Docker bool `yaml:"docker"` }
PipelineConfig is for any pipeline sections StepsMap is for compat with the multiple deploy target configs TODO(termie): it would be great to deprecate this behavior and switch
to multiple pipelines instead
type PipelineDefaultsUsed ¶
type PipelineDefaultsUsed struct {
IgnoreFile bool
}
type PipelineOptions ¶
type PipelineOptions struct { *GlobalOptions *AWSOptions *OCIOptions // *DockerOptions *GitOptions *ReporterOptions // TODO(termie): i'd like to remove this, it is only used in a couple // places by BasePipeline HostEnv *util.Environment RunID string DeployTarget string Pipeline string DockerNetworkName string ApplicationID string ApplicationName string ApplicationOwnerName string ApplicationStartedByName string WerckerContainerRegistry *url.URL ShouldCommit bool Repository string Tag string Message string ShouldStoreS3 bool ShouldStoreOCI bool // will be true if either ShouldStoreS3 or ShouldStoreOCI it true ShouldStore bool WorkingDir string GuestRoot string MntRoot string ReportRoot string // will be set by pipeline when it initializes PipelineBasePath string ProjectID string ProjectURL string ProjectPath string // Used when running workflows with fan-in locally. ProjectPathsByPipeline map[string]string CommandTimeout int NoResponseTimeout int ShouldArtifacts bool ShouldRemove bool SourceDir string IgnoreFile string AttachOnError bool DirectMount bool EnableDevSteps bool PublishPorts []string ExposePorts bool EnableVolumes bool WerckerYml string Checkpoint string DefaultsUsed PipelineDefaultsUsed WorkflowsInYml bool SuppressBuildLogs bool }
PipelineOptions for builds and deploys
func EmptyPipelineOptions ¶
func EmptyPipelineOptions() *PipelineOptions
func NewBuildOptions ¶
func NewBuildOptions(c util.Settings, e *util.Environment) (*PipelineOptions, error)
NewBuildOptions constructor
func NewCheckConfigOptions ¶
func NewCheckConfigOptions(c util.Settings, e *util.Environment) (*PipelineOptions, error)
NewCheckConfigOptions constructor
func NewDeployOptions ¶
func NewDeployOptions(c util.Settings, e *util.Environment) (*PipelineOptions, error)
NewDeployOptions constructor
func NewDevOptions ¶
func NewDevOptions(c util.Settings, e *util.Environment) (*PipelineOptions, error)
NewDevOptions ctor
func NewPipelineOptions ¶
func NewPipelineOptions(c util.Settings, e *util.Environment) (*PipelineOptions, error)
NewPipelineOptions big-ass constructor
func (*PipelineOptions) BasePath ¶
func (o *PipelineOptions) BasePath() string
func (*PipelineOptions) BuildPath ¶
func (o *PipelineOptions) BuildPath(s ...string) string
BuildPath returns the path where created builds live
func (*PipelineOptions) CachePath ¶
func (o *PipelineOptions) CachePath() string
CachePath returns the path for storing pipeline cache
func (*PipelineOptions) ContainerPath ¶
func (o *PipelineOptions) ContainerPath() string
ContainerPath returns the path where exported containers live
func (*PipelineOptions) GuestPath ¶
func (o *PipelineOptions) GuestPath(s ...string) string
GuestPath returns a path relative to the build root on the guest.
func (*PipelineOptions) HostPath ¶
func (o *PipelineOptions) HostPath(s ...string) string
HostPath returns a path relative to the build root on the host.
func (*PipelineOptions) IgnoreFilePath ¶
func (o *PipelineOptions) IgnoreFilePath() string
IgnoreFilePath return the absolute path of the ignore file
func (*PipelineOptions) MntPath ¶
func (o *PipelineOptions) MntPath(s ...string) string
MntPath returns a path relative to the read-only mount root on the guest.
func (*PipelineOptions) ProjectDownloadPath ¶
func (o *PipelineOptions) ProjectDownloadPath() string
ProjectDownloadPath returns the path where downloaded projects live
func (*PipelineOptions) ReportPath ¶
func (o *PipelineOptions) ReportPath(s ...string) string
ReportPath returns a path relative to the report root on the guest.
func (*PipelineOptions) SourcePath ¶
func (o *PipelineOptions) SourcePath() string
func (*PipelineOptions) StepPath ¶
func (o *PipelineOptions) StepPath() string
StepPath returns the path where downloaded steps live
func (*PipelineOptions) WorkflowURL ¶
func (o *PipelineOptions) WorkflowURL() string
func (*PipelineOptions) WorkingPath ¶
func (o *PipelineOptions) WorkingPath(s ...string) string
WorkingPath returns paths relative to our working dir (usually ".wercker")
type PipelineResult ¶
PipelineResult keeps track of the results of a build or deploy mostly so that we can use it to run after-steps
func (*PipelineResult) ExportEnvironment ¶
func (pr *PipelineResult) ExportEnvironment(sessionCtx context.Context, sess *Session) error
ExportEnvironment for this pipeline result (used in after-steps)
type PullOptions ¶
type PullOptions struct { *GlobalOptions Repository string Branch string Commit string Status string Result string Output string Load bool Force bool }
PullOptions for the pull command
func NewPullOptions ¶
func NewPullOptions(c util.Settings, e *util.Environment) (*PullOptions, error)
NewPullOptions constructor
type RawBoxConfig ¶
type RawBoxConfig struct {
*BoxConfig
}
RawBoxConfig is the unwrapper for BoxConfig
func (*RawBoxConfig) UnmarshalYAML ¶
func (r *RawBoxConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML first attempts to unmarshal as a string to ID otherwise attempts to unmarshal to the whole struct
type RawConfig ¶
type RawConfig struct {
*Config
}
RawConfig is the unwrapper for Config
func (*RawConfig) UnmarshalYAML ¶
UnmarshalYAML in this case is a little involved due to the myriad shapes our data can take for deploys (unfortunately), so we have to pretend the data is a map for a while and do a marshal/unmarshal hack to parse the subsections
type RawPipelineConfig ¶
type RawPipelineConfig struct {
*PipelineConfig
}
RawPipelineConfig is our unwrapper for PipelineConfig
func (*RawPipelineConfig) UnmarshalYAML ¶
func (r *RawPipelineConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML in this case is a little involved due to the myriad shapes our data can take for deploys (unfortunately), so we have to pretend the data is a map for a while and do a marshal/unmarshal hack to parse the subsections
type RawStepConfig ¶
type RawStepConfig struct {
*StepConfig
}
RawStepConfig is our unwrapper for config steps
func (*RawStepConfig) UnmarshalYAML ¶
func (r *RawStepConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML is fun, for this one as we're supporting three different types of yaml structures, a string, a map[string]map[string]string, and a map[string]string, these basically equate to these three styles of specifying the step that people commonly use:
steps: - string-step # this parses as a string - script: # this parses as a map[string]map[string]string code: done right - script: # this parses as a map[string]string code: done wrong
type RawStepsConfig ¶
type RawStepsConfig []*RawStepConfig
RawStepsConfig is a list of RawStepConfigs
type Receiver ¶
type Receiver struct {
// contains filtered or unexported fields
}
Receiver is for reading from our session
func NewReceiver ¶
NewReceiver returns a new channel-based io.Writer
type ReporterOptions ¶
type ReporterOptions struct { *GlobalOptions ReporterHost string ReporterKey string ShouldReport bool }
ReporterOptions for our reporting
func NewReporterOptions ¶
func NewReporterOptions(c util.Settings, e *util.Environment, globalOpts *GlobalOptions) (*ReporterOptions, error)
NewReporterOptions constructor
type S3Store ¶
type S3Store struct {
// contains filtered or unexported fields
}
S3Store stores files in S3
func (*S3Store) StoreFromFile ¶
func (s *S3Store) StoreFromFile(args *StoreFromFileArgs) error
StoreFromFile copies the file from args.Path to options.Bucket + args.Key.
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender is for sending to our session
type ServiceBox ¶
type ServiceBox interface { Run(context.Context, *util.Environment, []string) (*docker.Container, error) Fetch(ctx context.Context, env *util.Environment) (*docker.Image, error) GetID() string GetName() string GetServiceAlias() string }
ServiceBox interface to services
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is our way to interact with the docker container
func NewSession ¶
func NewSession(options *PipelineOptions, transport Transport) *Session
NewSession returns a new interactive session to a container.
func (*Session) Attach ¶
Attach us to our container and set up read and write queues. Returns a context object for the transport so we can propagate cancels on errors and closed connections.
func (*Session) HideLogs ¶
func (s *Session) HideLogs()
HideLogs will emit Logs with args.Hidden set to true
func (*Session) SendChecked ¶
func (s *Session) SendChecked(sessionCtx context.Context, commands ...string) (int, []string, error)
SendChecked sends commands, waits for them to complete and returns the exit status and output Ways to know a command is done:
[x] We received the sentinel echo [x] The container has exited and we've exhausted the incoming data [x] The session has closed and we've exhaused the incoming data [x] The command has timed out
Ways for a command to be successful:
[x] We received the sentinel echo with exit code 0
type Step ¶
type Step interface { // Bunch of getters DisplayName() string Env() *util.Environment Cwd() string ID() string Name() string Owner() string SafeID() string Version() string ShouldSyncEnv() bool Checkpoint() string // Actual methods Fetch() (string, error) InitEnv(context.Context, *util.Environment) error Execute(context.Context, *Session) (int, error) CollectFile(string, string, string, io.Writer) error CollectArtifact(context.Context, string) (*Artifact, error) // TODO(termie): don't think this needs to be universal ReportPath(...string) string Clean() }
Step interface for steps, to be renamed
type StepConfig ¶
type StepConfig struct { ID string Cwd string Name string Data map[string]string Checkpoint string }
StepConfig holds our step configs
type StepDesc ¶
type StepDesc struct { Name string Version string Description string Keywords []string Properties []StepDescProperty }
StepDesc represents a step.yml
func ReadStepDesc ¶
ReadStepDesc reads a file, expecting it to be parsed into a StepDesc.
type StepDescProperty ¶
StepDescProperty is the structure of the values in the "properties" section of the config
type Store ¶
type Store interface { // StoreFromFile copies a file from local disk to the store StoreFromFile(*StoreFromFileArgs) error }
Store is generic store interface
type StoreFromFileArgs ¶
type StoreFromFileArgs struct { // Path to the local file. Path string // Key of the file as stored in the store. Key string // ContentType hints to the content-type of the file (might be ignored) ContentType string // Meta data associated with the upload (might be ignored) Meta map[string]*string // MaxTries is the maximum that a store should retry should the store fail. MaxTries int }
StoreFromFileArgs are the args for storing a file
type Transport ¶
type Transport interface {
Attach(context.Context, io.Reader, io.Writer, io.Writer) (context.Context, error)
}
Transport interface for talking to containervisors
type VersionOptions ¶
VersionOptions contains the options associated with the version command.
func NewVersionOptions ¶
func NewVersionOptions(c util.Settings, e *util.Environment) (*VersionOptions, error)
NewVersionOptions constructor
type WerckerDockerOptions ¶
type WerckerDockerOptions struct { *GlobalOptions WerckerContainerRegistry *url.URL }
func NewWerckerDockerOptions ¶
func NewWerckerDockerOptions(c util.Settings, e *util.Environment) (*WerckerDockerOptions, error)
type WerckerRunnerOptions ¶
type WerckerRunnerOptions struct { *GlobalOptions RunnerName string RunnerGroup string RunnerOrgs string RunnerApps string Workflows string StorePath string LoggerPath string BearerToken string DockerEndpoint string ImageName string NumRunners int Polling int AllOption bool NoWait bool PullRemote bool Production bool OCIOptions *OCIOptions OCIDownload string }
WerckerRunnerOptions -
func NewExternalRunnerOptions ¶
func NewExternalRunnerOptions(c util.Settings, e *util.Environment) (*WerckerRunnerOptions, error)
NewExternalRunnerOptions -
type WerckerStepOptions ¶
type WerckerStepOptions struct { *GlobalOptions Owner string Private bool StepDir string }
func NewWerckerStepOptions ¶
func NewWerckerStepOptions(c util.Settings, e *util.Environment) (*WerckerStepOptions, error)
type WorkflowConfig ¶
type WorkflowConfig struct { Name string `yaml:"name"` Pipelines []WorkflowPipelineConfig `yaml:"pipelines"` }
WorkflowConfig is the data type for a workflow in yml file.
func (*WorkflowConfig) Validate ¶
func (workflow *WorkflowConfig) Validate(config *Config) error
Validate performs validation of the workflow
type WorkflowOptions ¶
type WorkflowOptions struct { PipelineOptions PipelineOptions WorkflowName string }
WorkflowOptions currently uses PipelineOptions along with its contructor for simplicity.
func NewWorkflowOptions ¶
func NewWorkflowOptions(c util.Settings, e *util.Environment) (*WorkflowOptions, error)
NewWorkflowOptions is a contructor for WorkflowOptions.
type WorkflowPipelineConfig ¶
type WorkflowPipelineConfig struct { Name string `yaml:"name"` PipelineName string `yaml:"pipelineName"` Requires []string `yaml:"requires"` ArtifactPipeline string `yaml:"artifactPipeline"` }
WorkflowPipelineConfig is the data type for a pipeline in workflow.
func (*WorkflowPipelineConfig) GetYAMLPipelineName ¶
func (wpc *WorkflowPipelineConfig) GetYAMLPipelineName() string
GetYAMLPipelineName returns name of the pipeline to run.
The need for two parameters, `name` and `pipelineName`, comes from the fact that it should possible to use the same pipeline under the different names in the same workflow (e.g. `deploy-staging` and `deploy-production` with the actual `deploy` pipeline).