put Step
Pushes to the given resource. Expand each section below for more details and examples.
put: resource.name | identifier (required)
When the step succeeds, the version by the step will be immediately fetched via an additional implicit
get step. This is so that later steps in your plan can use the artifact that was produced. The artifact
will be available under the identifier put specifies.
Getting and Putting
The following plan fetches a version using get and pushes it to another resource using put:
resource: resource.name
Defaults to the value of put. The resource to fetch, as configured in
pipeline.resources.
Use this attribute to rename a resource from the overall pipeline context into the job-specific context.
Re-labeling Put Resource
jobs:
- name: fetch-repo
plan:
# puts to "repo" and fetches new version under artifact name "thecode"
- put: thecode
resource: repo
params:
version: put-only
- task: ls-repo
config:
platform: linux
image_resource:
type: mock
source:
mirror_self: true
# pass the "thecode" artifact into the task
inputs:
- name: thecode
run:
path: ls
args:
- "-lah"
- "thecode"
resources:
- name: repo
type: mock
version: detect | all | [identifier]
Default detect.
When not set, or set to detect, the artifacts are detected based on the
configured put step params by looking for all string values and using
the first path segment as an identifier.
If set to all, all artifacts will be provided. This can result in slow
performance if the prior steps in the build plan register a bunch of large
artifacts before this step, so you may want to consider being explicit.
If configured as a list of identifiers, only the listed artifacts will be provided to the container.
Put Input Methods
jobs:
- name: put-input-methods
plan:
- in_parallel:
- get: repo-dev
- get: repo-master
- get: app-image
- get: ci
- put: detect-inputs
resource: repo
inputs: detect # default, will only stream the "ci" artifact
params:
file: ci/version.txt
- put: all-inputs
resource: repo
inputs: all # will stream all artifacts
params:
file: ci/version.txt
- put: explicit-inputs
resource: repo
inputs: # explicitly list artifacts to stream to put step
- ci
params:
file: ci/version.txt
resources:
- name: repo
type: mock
- name: repo-dev
type: mock
- name: repo-master
type: mock
- name: app-image
type: mock
- name: ci
type: mock
source:
create_files:
version.txt: "42"
params: config
Arbitrary configuration to pass to the resource. Refer to the resource type's documentation to see what it supports.
get_params: config
Arbitrary configuration to pass to the resource during the implicit get step. Refer to the resource type's
documentation to see what it supports.
Parameterizing the implicit get
You can control the settings of the implicit get step by setting get_params. For example, if you did not
want a put step utilizing the registry-image resource
type to download the image, you would implement your
put step as such:
no_get: boolean
Skips the get step that usually follows the completion of the put step.
This is useful to set if your put steps are at the very end of your job
and no further steps would use the artifact generated by the implicit
get step.