argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18k stars 5.48k forks source link

Obtain gitlab tags using SCM #12775

Open Demcheck opened 1 year ago

Demcheck commented 1 year ago

Summary

Hello everyone! I have small question about obtaining git tags from gitlab repositories. We use tags for deploying our applications to production. Example our deploying flow to prod:

  1. Open PR with code changes
  2. Merge this PR to master
  3. Setting tag for new commit
  4. Deploy apps to prod with new tag

Because we use tag for deploying we need to be able to obtain tags. But when I was seeing the source code of generator I haven't found anything about it. But gitlab client library is used in SCM generator and it can catch tags. My main qustion is how people usually deploy their application to production via ArgoCD in this case? Another one will you implement this thing in the future?

ngnix commented 1 year ago

Hello Argo Team, what do you say about adding support for git tags in the SCM provider?

ngnix commented 1 year ago

Hey guys, do you have any update?

aarthjo commented 1 year ago

Hey !

I'm really interested by this feature too.

We deploy a lot of applications via the SCM generator (in an ApplicationSet) but the filter parameter "branchMatch" doesn't detect the Gitlab tags but only the "branches".

For our applications deployed with the branches "ex : feature/ or fix/", no problems but for our applications which uses Gitlab tags, it isn't possible.

It will be possible to use an ApplicationSet and the Helm chart (https://artifacthub.io/packages/helm/argo/argocd-apps) to generate some applications on the fly but it's necessary to maintain a Helm values file with the list of all Gitlab tags. It isn't a good solution.

So, do you know if it's possible to detect the "tags" from the SCM filters or not ?

Do you think that's possible to implement this in a next release ?

Thanks a lot and sorry for my english ;-)

PS : Maybe an implementation of a new parameter in filter "tagsMatch" or something like that. PS2 : A function ListTags already exist here : https://github.com/xanzy/go-gitlab/blob/9e38892900c56f26a49e48a90d64ab95fc2a3edf/tags.go#L68

ivanfoo commented 8 months ago

This would be incredibly useful for our current use case. We use dedicated git tags to allow autodiscovery and sync of applications. However, as ApplicationSets cannot filter repositories by git tags, we ended up writing a tiny generator plugin.

Are there any plans to implement tag filtering support?

pmareke commented 8 months ago

This feature would be awesome for my team too!