redhat-developer / kam

GitOps Application Manager: An opinionated CLI that generates the Kubernetes resources for managing your Tekton-based CI manifests, ArgoCD-based CD manifests and Application manifests in Git.
Apache License 2.0
145 stars 83 forks source link

Opinionated Image Promotions #169

Closed mike4263 closed 2 years ago

mike4263 commented 3 years ago

Is your feature request related to a problem? Please describe. A task which updates the image digest in Git to initiate the deployment after the pipeline job is completed

Describe the solution you'd like There should be an opinionated method of updating the GitOps repo when the job is completed.

Describe alternatives you've considered I've seen a variety of other options proposed in the community - the ArgoCD Image Updater, kustomize set images or using oc patch --local to update the YAML directly. Whatever it is, I think kam should propose a default recommendation.

I think the utility should have a command that encapsulates this promotion, thinking something like kam promote --cicd-namespace=cicd --image-digest-from-pipeline=app-ci-pipeline-run-n44p4 --to-env=dev. It would also be cool if this could be baked in as a bootstrap option which would invoke this as a new Tekton task.

bigkevmcd commented 3 years ago

@mike4263 This is something that a lot of folks are working on (including this work)

How would you like this to work?

--image-digest-from-pipeline=app-ci-pipeline-run-n44p4 where does it get the image-digest from in that pipelinerun? an annotation? do you specify a result to query?

Does it open a PR? Does it apply a commit to the gitops repo directly?

Bearing in mind that the PR would look like...

-       image: quay.io/my-org/my-repo:SHA256@ab123cd321feg78
+       image: quay.io/my-org/my-repo:SHA256@fb81231adb29bb2
mike4263 commented 2 years ago

This is OBE by with the Argo Image Updater