Skip to content

Different Docker image tags for release and snapshot #4085

Closed Answered by caarlos0
mih-kopylov asked this question in Q&A
Discussion options

You must be logged in to vote

you can't pass ids to the release command.

you can use {{.IsSnapshot}} in the templates though.

PS: empty image names are ignored, so if you could do something like:

dockers:
  - 
    image_templates:
      - "{{ if not .IsSnapshot }}repo/name:{{ .Tag }}{{ end }}"
      - "{{ if not .IsSnapshot }}repo/name:{{ .Major }}{{ end }}"
      - "{{ if not .IsSnapshot }}repo/name:{{ .Major }}.{{ .Minor }}{{ end }}"
      - "{{ if not .IsSnapshot }}repo/name:latest{{ end }}"
      - "{{ if .IsSnapshot }}repo/name:{{ .Tag }}-SNAPSHOT{{ end }}"

finally, if you want to push snapshots, you'll need to do it manually, or use the nightly feature from goreleaser-pro.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mih-kopylov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants