{"modulePath":"github.com/docurated/atc","version":"v0.0.0-20160920180752-55917dda7c45","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package exec\n\n## Variables\n\n```go\nvar ErrInterrupted = errors.New(\"interrupted\")\n```\nErrInterrupted is returned by steps when they exited as a result of receiving a signal.\n\n## Types\n\n```go\ntype Aggregate []StepFactory\n```\nAggregate constructs a Step that will run each step in parallel.\n\n```go\nfunc (a Aggregate) Using(prev Step, repo *SourceRepository) Step\n```\nUsing delegates to each StepFactory and returns an AggregateStep.\n\n```go\ntype AggregateStep []Step\n```\nAggregateStep is a step of steps to run in parallel.\n\n```go\nfunc (step AggregateStep) Release()\n```\nRelease iterates over the steps and Releases them individually.\n\n```go\nfunc (step AggregateStep) Result(x interface{}) bool\n```\nResult indicates Success as true if all of the steps indicate Success as true, or if there were no steps at all. If none of the steps can indicate Success, it will return false and not indicate success itself.\n\nAll other result types are ignored, and Result will return false.\n\n```go\nfunc (step AggregateStep) Run(signals \u003c-chan os.Signal, ready chan\u003c- struct{}) error\n```\nRun executes all steps in parallel. It will indicate that it's ready when all of its steps are ready, and propagate any signal received to all running steps.\n\nIt will wait for all steps to exit, even if one step fails or errors. After all steps finish, their errors (if any) will be aggregated and returned as a single error.\n\n```go\ntype ArtifactDestination interface {\n\t// StreamIn is called with a destination directory and the tar stream to\n\t// expand into the destination directory.\n\tStreamIn(string, io.Reader) error\n}\n```\nArtifactDestination is the inverse of ArtifactSource. This interface allows the receiving end to determine the location of the data, e.g. based on a task's input configuration.\n\n```go\ntype ArtifactSource interface {\n\t// StreamTo copies the data from the source to the destination. Note that\n\t// this potentially uses a lot of network transfer, for larger artifacts, as\n\t// the ATC will effectively act as a middleman.\n\tStreamTo(ArtifactDestination) error\n\n\t// StreamFile returns the contents of a single file in the artifact source.\n\t// This is used for loading a task's configuration at runtime.\n\t//\n\t// If the file cannot be found, FileNotFoundError should be returned.\n\tStreamFile(path string) (io.ReadCloser, error)\n\n\t// VolumeOn attempts to locate a volume equivalent to this source on the\n\t// given worker. If a volume can be found, it will be used directly. If not,\n\t// `StreamTo` will be used to copy the data to the destination instead.\n\tVolumeOn(worker.Worker) (worker.Volume, bool, error)\n}\n```\nArtifactSource represents data produced by the steps, that can be transferred to other steps.\n\n```go\ntype DependentGetStep struct {\n\t// contains filtered or unexported fields\n}\n```\nDependentGetStep represents a Get step whose version is determined by the previous step. It is used to fetch the resource version produced by a PutStep.\n\n```go\nfunc (step DependentGetStep) Using(prev Step, repo *SourceRepository) Step\n```\nUsing constructs a GetStep that will fetch the version of the resource determined by the VersionInfo result of the previous step.\n\n```go\ntype DeprecationConfigSource struct {\n\tDelegate TaskConfigSource\n\tStderr   io.Writer\n}\n```\nDeprecationConfigSource represents a statically configured TaskConfig.\n\n```go\nfunc (configSource DeprecationConfigSource) FetchConfig(repo *SourceRepository) (atc.TaskConfig, error)\n```\nFetchConfig returns the configuration. It cannot fail.\n\n```go\nfunc (configSource DeprecationConfigSource) Warnings() []string\n```\n\n```go\ntype EnsureStep struct {\n\t// contains filtered or unexported fields\n}\n```\nEnsureStep will run one step, and then a second step regardless of whether the first step fails or errors.\n\n```go\nfunc Ensure(firstStep StepFactory, secondStep StepFactory) EnsureStep\n```\nEnsure constructs an EnsureStep factory.\n\n```go\nfunc (o *EnsureStep) Release()\n```\nRelease releases both steps.\n\n```go\nfunc (o *EnsureStep) Result(x interface{}) bool\n```\nResult indicates Success by and-ing together both step's Success results. If either of them cannot indicate Success, it returns false.\n\nAll other result types are ignored.\n\n```go\nfunc (o *EnsureStep) Run(signals \u003c-chan os.Signal, ready chan\u003c- struct{}) error\n```\nRun will call Run on the first step, wait for it to complete, and then call Run on the second step, regardless of whether the first step failed or errored.\n\nIf the first step or the second step errors, an aggregate of their errors is returned.\n\n```go\nfunc (o EnsureStep) Using(prev Step, repo *SourceRepository) Step\n```\nUsing constructs an \\*EnsureStep.\n\n```go\ntype ExitStatus int\n```\nExitStatus is the resulting exit code from the process that the step ran. Typically if the ExitStatus result is 0, the Success result is true.\n\n```go\ntype Factory interface {\n\t// Get constructs a GetStep factory.\n\tGet(\n\t\tlager.Logger,\n\t\tStepMetadata,\n\t\tSourceName,\n\t\tworker.Identifier,\n\t\tworker.Metadata,\n\t\tGetDelegate,\n\t\tatc.ResourceConfig,\n\t\tatc.Tags,\n\t\tint,\n\t\tatc.Params,\n\t\tatc.Version,\n\t\tatc.ResourceTypes,\n\t\ttime.Duration,\n\t\ttime.Duration,\n\t) StepFactory\n\n\t// Put constructs a PutStep factory.\n\tPut(\n\t\tlager.Logger,\n\t\tStepMetadata,\n\t\tworker.Identifier,\n\t\tworker.Metadata,\n\t\tPutDelegate,\n\t\tatc.ResourceConfig,\n\t\tatc.Tags,\n\t\tint,\n\t\tatc.Params,\n\t\tatc.ResourceTypes,\n\t\ttime.Duration,\n\t\ttime.Duration,\n\t) StepFactory\n\n\t// DependentGet constructs a GetStep factory whose version is determined by\n\t// the previous step.\n\tDependentGet(\n\t\tlager.Logger,\n\t\tStepMetadata,\n\t\tSourceName,\n\t\tworker.Identifier,\n\t\tworker.Metadata,\n\t\tGetDelegate,\n\t\tatc.ResourceConfig,\n\t\tatc.Tags,\n\t\tint,\n\t\tatc.Params,\n\t\tatc.ResourceTypes,\n\t\ttime.Duration,\n\t\ttime.Duration,\n\t) StepFactory\n\n\t// Task constructs a TaskStep factory.\n\tTask(\n\t\tlager.Logger,\n\t\tSourceName,\n\t\tworker.Identifier,\n\t\tworker.Metadata,\n\t\tTaskDelegate,\n\t\tPrivileged,\n\t\tatc.Tags,\n\t\tint,\n\t\tTaskConfigSource,\n\t\tatc.ResourceTypes,\n\t\tmap[string]string,\n\t\tmap[string]string,\n\t\tstring,\n\t\tclock.Clock,\n\t\ttime.Duration,\n\t\ttime.Duration,\n\t) StepFactory\n}\n```\nFactory is used when building up the steps for a build.\n\n```go\nfunc NewGardenFactory(\n\tworkerClient worker.Client,\n\ttracker resource.Tracker,\n\tresourceFetcher resource.Fetcher,\n) Factory\n```\n\n```go\ntype FileConfigSource struct {\n\tPath string\n}\n```\nFileConfigSource represents a dynamically configured TaskConfig, which will be fetched from a specified file in the SourceRepository.\n\n```go\nfunc (configSource FileConfigSource) FetchConfig(repo *SourceRepository) (atc.TaskConfig, error)\n```\nFetchConfig reads the specified file from the SourceRepository and loads the TaskConfig contained therein (expecting it to be YAML format).\n\nThe path must be in the format SOURCE\\_NAME/FILE/PATH.yml. The SOURCE\\_NAME will be used to determine the ArtifactSource in the SourceRepository to stream the file out of.\n\nIf the source name is missing (i.e. if the path is just \"foo.yml\"), UnspecifiedArtifactSourceError is returned.\n\nIf the specified source name cannot be found, UnknownArtifactSourceError is returned.\n\nIf the task config file is not found, or is invalid YAML, or is an invalid task configuration, the respective errors will be bubbled up.\n\n```go\nfunc (configSource FileConfigSource) Warnings() []string\n```\n\n```go\ntype FileNotFoundError struct {\n\tPath string\n}\n```\nFileNotFoundError is the error to return from StreamFile when the given path does not exist.\n\n```go\nfunc (err FileNotFoundError) Error() string\n```\nError prints a helpful message including the file path. The user will see this message if e.g. their task config path does not exist.\n\n```go\ntype GetDelegate interface {\n\tResourceDelegate\n}\n```\nGetDelegate is used to record events related to a GetStep's runtime behavior.\n\n```go\ntype GetStep struct {\n\t// contains filtered or unexported fields\n}\n```\nGetStep will fetch a version of a resource on a worker that supports the resource type.\n\n```go\nfunc (step *GetStep) Release()\n```\n\n```go\nfunc (step *GetStep) Result(x interface{}) bool\n```\nResult indicates Success as true if the script completed successfully (or didn't have to run) and everything else worked fine.\n\nIt also indicates VersionInfo with the fetched or cached resource's version and metadata.\n\nAll other types are ignored.\n\n```go\nfunc (step *GetStep) Run(signals \u003c-chan os.Signal, ready chan\u003c- struct{}) error\n```\nRun ultimately registers the configured resource version's ArtifactSource under the configured SourceName. How it actually does this is determined by a few factors.\n\nFirst, a worker that supports the given resource type is chosen, and a container is created on the worker.\n\nIf the worker has a VolumeManager, and its cache is already warmed, the cache will be mounted into the container, and no fetching will be performed. The container will be used to stream the contents of the cache to later steps that require the artifact but are running on a worker that does not have the cache.\n\nIf the worker does not have a VolumeManager, or if the worker does have a VolumeManager but a cache for the version of the resource is not present, the specified version of the resource will be fetched. As long as running the fetch script works, Run will return nil regardless of its exit status.\n\nIf the worker has a VolumeManager but did not have the cache initially, the fetched ArtifactSource is initialized, thus warming the worker's cache.\n\nAt the end, the resulting ArtifactSource (either from using the cache or fetching the resource) is registered under the step's SourceName.\n\n```go\nfunc (step *GetStep) StreamFile(path string) (io.ReadCloser, error)\n```\nStreamFile streams a single file out of the resource.\n\n```go\nfunc (step *GetStep) StreamTo(destination ArtifactDestination) error\n```\nStreamTo streams the resource's data to the destination.\n\n```go\nfunc (step GetStep) Using(prev Step, repo *SourceRepository) Step\n```\nUsing finishes construction of the GetStep and returns a \\*GetStep. If the \\*GetStep errors, its error is reported to the delegate.\n\n```go\nfunc (step *GetStep) VolumeOn(worker worker.Worker) (worker.Volume, bool, error)\n```\nVolumeOn locates the cache for the GetStep's resource and version on the given worker.\n\n```go\ntype Identity struct{}\n```\nIdentity constructs a step that just propagates the previous step to the next one, without running anything.\n\n```go\nfunc (Identity) Using(prev Step, repo *SourceRepository) Step\n```\nUsing constructs an IdentityStep.\n\n```go\ntype IdentityStep struct {\n\tStep\n}\n```\nIdentityStep does nothing, and delegates everything else to its nested step.\n\n```go\nfunc (IdentityStep) Run(\u003c-chan os.Signal, chan\u003c- struct{}) error\n```\nRun does nothing.\n\n```go\ntype MergedConfigSource struct {\n\tA TaskConfigSource\n\tB TaskConfigSource\n}\n```\nMergedConfigSource is used to join two config sources together.\n\n```go\nfunc (configSource MergedConfigSource) FetchConfig(source *SourceRepository) (atc.TaskConfig, error)\n```\nFetchConfig fetches both config sources, and merges the second config source into the first. This allows the user to set params required by a task loaded from a file by providing them in static configuration.\n\n```go\nfunc (configSource MergedConfigSource) Warnings() []string\n```\n\n```go\ntype MissingInputsError struct {\n\tInputs []string\n}\n```\nMissingInputsError is returned when any of the task's required inputs are missing.\n\n```go\nfunc (err MissingInputsError) Error() string\n```\nError prints a human-friendly message listing the inputs that were missing.\n\n```go\ntype NoopStep struct{}\n```\nNoopStep implements a step that successfully does nothing.\n\n```go\nfunc (NoopStep) Release()\n```\nRelease does nothing as there are no resources consumed by the NoopStep.\n\n```go\nfunc (NoopStep) Result(interface{}) bool\n```\nResult returns false. Arguably it should at least be able to indicate Success (as true), though it currently does not.\n\n```go\nfunc (NoopStep) Run(\u003c-chan os.Signal, chan\u003c- struct{}) error\n```\nRun returns nil immediately without doing anything. It does not bother indicating that it's ready or listening for signals.\n\n```go\ntype OnFailureStep struct {\n\t// contains filtered or unexported fields\n}\n```\nOnFailureStep will run one step, and then a second step if the first step fails (but not errors).\n\n```go\nfunc OnFailure(firstStep StepFactory, secondStep StepFactory) OnFailureStep\n```\nOnFailure constructs an OnFailureStep factory.\n\n```go\nfunc (o *OnFailureStep) Release()\n```\nRelease releases both steps.\n\n```go\nfunc (o *OnFailureStep) Result(x interface{}) bool\n```\nResult indicates Success as true if the first step completed successfully.\n\nAny other type is ignored.\n\n```go\nfunc (o *OnFailureStep) Run(signals \u003c-chan os.Signal, ready chan\u003c- struct{}) error\n```\nRun will call Run on the first step and wait for it to complete. If the first step errors, Run returns the error. OnFailureStep is ready as soon as the first step is ready.\n\nIf the first step fails (that is, its Success result is false), the second step is executed. If the second step errors, its error is returned.\n\n```go\nfunc (o OnFailureStep) Using(prev Step, repo *SourceRepository) Step\n```\nUsing constructs an \\*OnFailureStep.\n\n```go\ntype OnSuccessStep struct {\n\t// contains filtered or unexported fields\n}\n```\nOnSuccessStep will run one step, and then a second step if the first step succeeds.\n\n```go\nfunc OnSuccess(firstStep StepFactory, secondStep StepFactory) OnSuccessStep\n```\nOnSuccess constructs an OnSuccessStep factory.\n\n```go\nfunc (o *OnSuccessStep) Release()\n```\nRelease releases both steps.\n\n```go\nfunc (o *OnSuccessStep) Result(x interface{}) bool\n```\nResult indicates Success as true if the first step completed and the second step completed successfully.\n\nAny other type is ignored.\n\n```go\nfunc (o *OnSuccessStep) Run(signals \u003c-chan os.Signal, ready chan\u003c- struct{}) error\n```\nRun will call Run on the first step and wait for it to complete. If the first step errors, Run returns the error. OnSuccessStep is ready as soon as the first step is ready.\n\nIf the first step succeeds (that is, its Success result is true), the second step is executed. If the second step errors, its error is returned.\n\n```go\nfunc (o OnSuccessStep) Using(prev Step, repo *SourceRepository) Step\n```\nUsing constructs an \\*OnSuccessStep.\n\n```go\ntype Privileged bool\n```\nPrivileged is used to indicate whether the given step should run with special privileges (i.e. as an administrator user).\n\n```go\ntype PutDelegate interface {\n\tResourceDelegate\n}\n```\nPutDelegate is used to record events related to a PutStep's runtime behavior.\n\n```go\ntype PutStep struct {\n\t// contains filtered or unexported fields\n}\n```\nPutStep produces a resource version using preconfigured params and any data available in the SourceRepository.\n\n```go\nfunc (step *PutStep) Release()\n```\n\n```go\nfunc (step *PutStep) Result(x interface{}) bool\n```\nResult indicates Success as true if the script completed with exit status 0.\n\nIt also indicates VersionInfo returned by the script.\n\nAny other type is ignored.\n\n```go\nfunc (step *PutStep) Run(signals \u003c-chan os.Signal, ready chan\u003c- struct{}) error\n```\nRun chooses a worker that supports the step's resource type and creates a container.\n\nAll ArtifactSources present in the SourceRepository are then brought into the container, using volumes if possible, and streaming content over if not.\n\nThe resource's put script is then invoked. The PutStep is ready as soon as the resource's script starts, and signals will be forwarded to the script.\n\n```go\nfunc (step PutStep) Using(prev Step, repo *SourceRepository) Step\n```\nUsing finishes construction of the PutStep and returns a \\*PutStep. If the \\*PutStep errors, its error is reported to the delegate.\n\n```go\ntype ResourceDelegate interface {\n\tInitializing()\n\n\tCompleted(ExitStatus, *VersionInfo)\n\tFailed(error)\n\n\tImageVersionDetermined(worker.VolumeIdentifier) error\n\n\tStdout() io.Writer\n\tStderr() io.Writer\n}\n```\nResourceDelegate is used to record events related to a resource's runtime behavior.\n\n```go\ntype Retry []StepFactory\n```\nRetry constructs a Step that will run the steps in order until one of them succeeds.\n\n```go\nfunc (stepFactory Retry) Using(prev Step, repo *SourceRepository) Step\n```\nUsing constructs a \\*RetryStep.\n\n```go\ntype RetryStep struct {\n\tAttempts    []Step\n\tLastAttempt Step\n}\n```\nRetryStep is a step that will run the steps in order until one of them succeeds.\n\n```go\nfunc (step *RetryStep) Release()\n```\nRelease releases each nested step.\n\n```go\nfunc (step *RetryStep) Result(x interface{}) bool\n```\nResult delegates to the last step that it ran.\n\n```go\nfunc (step *RetryStep) Run(signals \u003c-chan os.Signal, ready chan\u003c- struct{}) error\n```\nRun iterates through each step, stopping once a step succeeds. If all steps fail, the RetryStep will fail.\n\n```go\ntype SourceName string\n```\nSourceName is just a string, with its own type to make interfaces using it more self-documenting.\n\n```go\ntype SourceRepository struct {\n\t// contains filtered or unexported fields\n}\n```\nSourceRepository is the mapping from a SourceName to an ArtifactSource. Steps will both populate this map with new artifacts (e.g.  the resource fetched by a Get step), and look up required artifacts (e.g.  the inputs configured for a Task step).\n\nThere is only one SourceRepository for the duration of a build plan's execution.\n\nSourceRepository is, itself, an ArtifactSource. As an ArtifactSource it acts as the set of all ArtifactSources it contains, as if they were each in subdirectories corresponding to their SourceName.\n\n```go\nfunc NewSourceRepository() *SourceRepository\n```\nNewSourceRepository constructs a new repository.\n\n```go\nfunc (repo *SourceRepository) AsMap() map[SourceName]ArtifactSource\n```\nAsMap extracts the current contents of the SourceRepository into a new map and returns it. Changes to the returned map or the SourceRepository will not affect each other.\n\n```go\nfunc (repo *SourceRepository) RegisterSource(name SourceName, source ArtifactSource)\n```\nRegisterSource inserts an ArtifactSource into the map under the given SourceName. Producers of artifacts, e.g. the Get step and the Task step, will call this after they've successfully produced their artifact(s).\n\n```go\nfunc (repo *SourceRepository) ScopedTo(names ...SourceName) (*SourceRepository, error)\n```\nScopedTo returns a new SourceRepository restricted to the given set of SourceNames. This is used by the Put step to stream in the sources that did not have a volume available on its destination.\n\n```go\nfunc (repo *SourceRepository) SourceFor(name SourceName) (ArtifactSource, bool)\n```\nSourceFor looks up an ArtifactSource for the given SourceName. Consumers of artifacts, e.g. the Task step, will call this to locate their dependencies.\n\n```go\nfunc (repo *SourceRepository) StreamFile(path string) (io.ReadCloser, error)\n```\nStreamFile streams a single file out of the repository, using the first path segment to determine the ArtifactSource to stream out of. For example, StreamFile(\"a/b.yml\") will look up the \"a\" ArtifactSource and return the result of StreamFile(\"b.yml\") on it.\n\nIf the ArtifactSource determined by the path is not present, FileNotFoundError will be returned.\n\n```go\nfunc (repo *SourceRepository) StreamTo(dest ArtifactDestination) error\n```\nStreamTo will stream all currently registered artifacts to the destination. This is used by the Put step, which currently does not have an explicit set of dependencies, and instead just pulls in everything.\n\nEach ArtifactSource will be streamed to a subdirectory matching its SourceName.\n\n```go\nfunc (repo *SourceRepository) VolumeOn(worker worker.Worker) (worker.Volume, bool, error)\n```\nVolumeOn returns nothing, as it's impossible for there to be a single volume representing all ArtifactSources.\n\n```go\ntype StaticConfigSource struct {\n\tPlan atc.TaskPlan\n}\n```\nStaticConfigSource represents a statically configured TaskConfig.\n\n```go\nfunc (configSource StaticConfigSource) FetchConfig(*SourceRepository) (atc.TaskConfig, error)\n```\nFetchConfig returns the configuration.\n\n```go\nfunc (configSource StaticConfigSource) Warnings() []string\n```\n\n```go\ntype Step interface {\n\t// Run is called when it's time to execute the step. It should indicate when\n\t// it's ready, and listen for signals at points where the potential time is\n\t// unbounded (i.e. running a task or a resource action).\n\t//\n\t// Steps wrapping other steps should be careful to propagate signals and\n\t// indicate that they're ready as soon as their wrapped steps are ready.\n\t//\n\t// Steps should return ErrInterrupted if they received a signal that caused\n\t// them to stop.\n\t//\n\t// Steps must be idempotent. Each step is responsible for handling its own\n\t// idempotency; usually this is done by saving off \"checkpoints\" in some way\n\t// that can be checked again if the step starts running again from the start.\n\t// For example, by having the ID for a container be deterministic and unique\n\t// for each step, and checking for properties on the container to determine\n\t// how far the step got.\n\tifrit.Runner\n\n\t// Release is called when the build has completed and no more steps will be\n\t// executed in the build plan. Steps with containers should release their\n\t// containers with infinite ttl\n\t// Container reaper will check for successful builds and set the containers' ttl to 5 minutes.\n\t// Container reaper also checks for unsuccessful (failed, aborted, errored) builds\n\t// that are not the latest builds of a job, and release their containers in 5 minutes\n\tRelease()\n\n\t// Result is used to collect metadata from the step. Usually this is\n\t// `Success`, but some steps support more types (e.g. `VersionInfo`).\n\t//\n\t// Result returns a bool indicating whether it was able to populate the\n\t// destination. If the destination's type is unknown to the step, it must\n\t// return false.\n\t//\n\t// Implementers of this method MUST not mutate the given pointer if they\n\t// are unable to respond (i.e. returning false from this function).\n\tResult(interface{}) bool\n}\n```\nA Step is an object that can be executed, whose result (e.g. Success) can be collected, and whose dependent resources (e.g. Containers, Volumes) can be released, allowing them to expire.\n\n```go\ntype StepFactory interface {\n\tUsing(Step, *SourceRepository) Step\n}\n```\nStepFactory constructs a step. The previous step and source repository are provided.\n\nSome steps, i.e. DependentGetStep, use information from the previous step to determine how to run.\n\n```go\ntype StepMetadata interface {\n\tEnv() []string\n}\n```\nStepMetadata is used to inject metadata to make available to the step when it's running.\n\n```go\ntype Success bool\n```\nSuccess indicates whether a step completed successfully.\n\n```go\ntype TaskConfigSource interface {\n\t// FetchConfig returns the TaskConfig, and may have to a task config file out\n\t// of the SourceRepository.\n\tFetchConfig(*SourceRepository) (atc.TaskConfig, error)\n\tWarnings() []string\n}\n```\nTaskConfigSource is used to determine a Task step's TaskConfig.\n\n```go\ntype TaskDelegate interface {\n\tInitializing(atc.TaskConfig)\n\tStarted()\n\n\tFinished(ExitStatus)\n\tFailed(error)\n\n\tImageVersionDetermined(worker.VolumeIdentifier) error\n\n\tStdout() io.Writer\n\tStderr() io.Writer\n}\n```\nTaskDelegate is used to record events related to a TaskStep's runtime behavior.\n\n```go\ntype TaskStep struct {\n\t// contains filtered or unexported fields\n}\n```\nTaskStep executes a TaskConfig, whose inputs will be fetched from the SourceRepository and outputs will be added to the SourceRepository.\n\n```go\nfunc (step *TaskStep) Release()\n```\n\n```go\nfunc (step *TaskStep) Result(x interface{}) bool\n```\nResult indicates Success as true if the script's exit status was 0.\n\nIt also indicates ExitStatus as the exit status of the script.\n\nAll other types are ignored.\n\n```go\nfunc (step *TaskStep) Run(signals \u003c-chan os.Signal, ready chan\u003c- struct{}) error\n```\nRun will first load the TaskConfig. A worker will be selected based on the TaskConfig's platform, the TaskStep's tags, and prioritized by availability of volumes for the TaskConfig's inputs. Inputs that did not have volumes available on the worker will be streamed in to the container.\n\nIf any inputs are not available in the SourceRepository, MissingInputsError is returned.\n\nOnce all the inputs are satisfies, the task's script will be executed, and the RunStep indicates that it's ready, and any signals will be forwarded to the script.\n\nIf the script exits successfully, the outputs specified in the TaskConfig are registered with the SourceRepository. If no outputs are specified, the task's entire working directory is registered as an ArtifactSource under the name of the task.\n\n```go\nfunc (step TaskStep) Using(prev Step, repo *SourceRepository) Step\n```\nUsing finishes construction of the TaskStep and returns a \\*TaskStep. If the \\*TaskStep errors, its error is reported to the delegate.\n\n```go\ntype TimeoutStep struct {\n\t// contains filtered or unexported fields\n}\n```\nTimeoutStep applies a fixed timeout to a step's Run.\n\n```go\nfunc Timeout(\n\tstep StepFactory,\n\tduration string,\n\tclock clock.Clock,\n) TimeoutStep\n```\nTimeout constructs a TimeoutStep factory.\n\n```go\nfunc (ts *TimeoutStep) Release()\n```\nRelease releases the nested step.\n\n```go\nfunc (ts *TimeoutStep) Result(x interface{}) bool\n```\nResult indicates Success as true if the nested step completed successfully and did not time out.\n\nAny other type is ignored.\n\n```go\nfunc (ts *TimeoutStep) Run(signals \u003c-chan os.Signal, ready chan\u003c- struct{}) error\n```\nRun parses the timeout duration and invokes the nested step.\n\nIf the nested step takes longer than the duration, it is sent the Interrupt signal, and the TimeoutStep returns nil once the nested step exits (ignoring the nested step's error).\n\nThe result of the nested step's Run is returned.\n\n```go\nfunc (ts TimeoutStep) Using(prev Step, repo *SourceRepository) Step\n```\nUsing constructs a \\*TimeoutStep.\n\n```go\ntype TrackerFactory interface {\n\tTrackerFor(client worker.Client) resource.Tracker\n}\n```\n\n```go\ntype TryStep struct {\n\t// contains filtered or unexported fields\n}\n```\nTryStep wraps another step, ignores its errors, and always succeeds.\n\n```go\nfunc Try(step StepFactory) TryStep\n```\nTry constructs a TryStep factory.\n\n```go\nfunc (ts *TryStep) Release()\n```\nRelease releases the nested step.\n\n```go\nfunc (ts *TryStep) Result(x interface{}) bool\n```\nResult indicates Success as true, and delegates everything else to the nested step.\n\n```go\nfunc (ts *TryStep) Run(signals \u003c-chan os.Signal, ready chan\u003c- struct{}) error\n```\nRun runs the nested step, and always returns nil, ignoring the nested step's error.\n\n```go\nfunc (ts TryStep) Using(prev Step, repo *SourceRepository) Step\n```\nUsing constructs a \\*TryStep.\n\n```go\ntype UnknownArtifactSourceError struct {\n\tSourceName SourceName\n}\n```\nUnknownArtifactSourceError is returned when the SourceName specified by the path does not exist in the SourceRepository.\n\n```go\nfunc (err UnknownArtifactSourceError) Error() string\n```\nError returns a human-friendly error message.\n\n```go\ntype UnspecifiedArtifactSourceError struct {\n\tPath string\n}\n```\nUnspecifiedArtifactSourceError is returned when the specified path is of a file in the toplevel directory, and so it does not indicate a SourceName.\n\n```go\nfunc (err UnspecifiedArtifactSourceError) Error() string\n```\nError returns a human-friendly error message.\n\n```go\ntype ValidatingConfigSource struct {\n\tConfigSource TaskConfigSource\n}\n```\nValidatingConfigSource delegates to another ConfigSource, and validates its task config.\n\n```go\nfunc (configSource ValidatingConfigSource) FetchConfig(source *SourceRepository) (atc.TaskConfig, error)\n```\nFetchConfig fetches the config using the underlying ConfigSource, and checks that it's valid.\n\n```go\nfunc (configSource ValidatingConfigSource) Warnings() []string\n```\n\n```go\ntype VersionInfo struct {\n\tVersion  atc.Version\n\tMetadata []atc.MetadataField\n}\n```\nVersionInfo is the version and metadata of a resource that was fetched or produced. It is used by Put, Get, and DependentGet.\n\n","path":"github.com/docurated/atc/exec","name":"exec","synopsis":"","isRedistributable":true}
