s3-resource
s3-resource copied to clipboard
What is the "key" (prefix) for versions extracted from filename by s3 resource?
https://concourse-ci.org/managing-resources.html#fly-pin-resource
To pin a resource to a specific version of that resource, run:
$ fly -t example pin-resource --resource my-pipeline/my-resource \ --version ref:bceaf
Note that the version needs to be provided as a key-value pair. For the git resource theref:
prefix is used while the registry resource might usedigest
as a prefix likedigest:sha256:94be7d7b
.
So if we're using s3 resource to watch a file, and the version is extracted from the filename, what is the key prefix for this version?
well I found fly resource-versions
and was able to determine the answer
our resource def looks like:
- name: name-of-bucket-resource
type: s3-iam
source:
bucket: us-east-1-some-app-bucket
regexp: blah/blah/blah/(v.*)
region_name: us-east-1
and the filenames in the bucket look like v1.0.23477-dfc0bed61
from what it says in the readme I was expecting the version to be the captured group i.e. v1.0.23477-dfc0bed61
instead the version is the full path blah/blah/blah/v1.0.23477-dfc0bed61
and the prefix is path
so we can pin the resource versions like:
fly -t example pin-resource \
--resource my-pipeline/name-of-bucket-resource \
--version path:blah/blah/blah/v1.0.23477-dfc0bed61