Skip to content

Commit

Permalink
Prevent pre-releases from creating latest images
Browse files Browse the repository at this point in the history
  • Loading branch information
corvus-ch committed Dec 21, 2020
1 parent f7e65da commit e40ff6f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ snapshot:
name_template: "{{ .Tag }}-snapshot"

dockers:
# The `latest` is not touched for pre release.
# The template string `{{ if .Prerelease }}v{{ .Version }}{{ else }}latest{{ end }}`
# will compute to `latest` for regular release. For pre releases, it will
# compute to `v{{ .Version }}`. This duplicates one of the other list items
# and therefore eliminates `latest` from the list. This is OK to do since
# `goreleaser` builds the image only once and tagging is a cheap operation.
- image_templates:
- "docker.io/vshn/k8up:latest"
- "docker.io/vshn/k8up:{{ if .Prerelease }}v{{ .Version }}{{ else }}latest{{ end }}"
- "docker.io/vshn/k8up:v{{ .Version }}"
- "docker.io/vshn/k8up:v{{ .Major }}"
- "quay.io/vshn/k8up:latest"
- "quay.io/vshn/k8up:{{ if .Prerelease }}v{{ .Version }}{{ else }}latest{{ end }}"
- "quay.io/vshn/k8up:v{{ .Version }}"
- "quay.io/vshn/k8up:v{{ .Major }}"

Expand Down

0 comments on commit e40ff6f

Please sign in to comment.