TykTechnologies / tyk-operator

Tyk Operator for Kubernetes
https://tyk.io
Other
198 stars 40 forks source link

build and publish latest docker tag upon merge to master #251

Closed asoorm closed 3 years ago

asoorm commented 3 years ago

At present, latest docker image is only built when we cut a release. This causes problems, because master branch of tyk-operator (CRDs) might then be out-of-sync with the tyk-operator:latest docker tag. We also must consider the use-case for making release-candidates available.

Currently we have goreleaser.yaml with

image_templates:
  "tykio/tyk-operator:latest"
  "tykio/tyk-operator:v{{ .Major }}"
  "tykio/tyk-operator:v{{ .Major }}.{{ .Minor }}"
  "tykio/tyk-operator:{{ .Tag }}"

Which we is executed when we push a release tag like v0.5.0

What we need is:

When we marge/push any change to master, a workflow should be triggered that only builds latest docker image

image_templates:
  "tykio/tyk-operator:latest"

And when we push a release candidate v0.5.0-rc1 only build docker image for that specific tag

image_templates:
  "tykio/tyk-operator:{{ .Tag }}"

When we push a release tag v0.5.0 don't tag latest

image_templates:
  "tykio/tyk-operator:v{{ .Major }}"
  "tykio/tyk-operator:v{{ .Major }}.{{ .Minor }}"
  "tykio/tyk-operator:{{ .Tag }}"
alephnull commented 3 years ago

https://github.com/TykTechnologies/tyk-operator/blob/master/.github/workflows/release_tag.yaml#L9-L11 is setup such that it is triggered when a tag is pushed. It can be configured to operate on master.

goreleaser has been configured to always push the latest tag on every image it pushes.

alephnull commented 3 years ago

Please add this to the DevOps jira if you'd like one of us to work on it, but it is a small change that can be made by anyone really. Happy to hop on a zoom with anyone who is interested.

gernest commented 3 years ago

@alephnull I created a jira ticket to track this with additional details https://tyktech.atlassian.net/browse/TT-1617 please take a look at it.