concourse / registry-image-resource

a resource for images in a Docker registry
Apache License 2.0
89 stars 107 forks source link

feat: support arbitrary prerelease strings #342

Open cjnosal opened 1 year ago

cjnosal commented 1 year ago

The current implementation assumes the prerelease portion of a semver tag is alpha/beta/rc optionally followed by a variant, with no other - characters. This MR adds two new source params to broaden support for arbitrary semver tags while maintaining backwards compatibility:

source.pre_release_prefixes lets the user append to the default prefixes of alpha/beta/rc (e.g. "dev" or "build")without otherwise changing the current pre_releases behaviour. Setting pre_release_prefixes skips the "pre-release contains -" check.

source.tag_regex lets users match against arbitrary expressions. source.pre_releases is ignored when a regex is set. semver_constraint and variant can still be used in combination with tag_regex.

fix https://github.com/concourse/registry-image-resource/issues/307