From 509dc7a8457efb6f6bea46f1dd9d6c1fc02a185a Mon Sep 17 00:00:00 2001 From: Mathieu LAUDE Date: Thu, 11 Jul 2024 14:59:37 +0200 Subject: [PATCH] feat: :sparkles: calculate app name from repo url --- charts/dso-env/Chart.yaml | 2 +- charts/dso-env/README.md | 4 ++-- charts/dso-env/templates/application-app.yaml | 2 +- charts/dso-env/values.yaml | 3 +-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/charts/dso-env/Chart.yaml b/charts/dso-env/Chart.yaml index b3f85c5..7c5239a 100644 --- a/charts/dso-env/Chart.yaml +++ b/charts/dso-env/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: dso-env description: Creates argocd Project and Applications to deploy DSO project repositories. type: application -version: 1.2.0 +version: 1.2.1 appVersion: 1.0.0 maintainers: - name: this-is-tobi diff --git a/charts/dso-env/README.md b/charts/dso-env/README.md index 1dc9349..964997d 100644 --- a/charts/dso-env/README.md +++ b/charts/dso-env/README.md @@ -1,6 +1,6 @@ # dso-env -![Version: 1.2.0](https://img.shields.io/badge/Version-1.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) +![Version: 1.2.1](https://img.shields.io/badge/Version-1.2.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) Creates argocd Project and Applications to deploy DSO project repositories. @@ -16,7 +16,7 @@ Creates argocd Project and Applications to deploy DSO project repositories. |-----|------|---------|-------------| | application.destination.name | string | `"dest"` | Nom du cluster applicatif cible | | application.destination.namespace | string | `"app1"` | Nom du namespace applicatif cible | -| application.repositories | list | `[{"name":"quota-explorer","path":".","repoURL":"https://gitlab.com/projects/org/demo/quota-explorer.git","targetRevision":"main"}]` | Liste des dépôts à déployer | +| application.repositories | list | `[{"path":".","repoURL":"https://gitlab.com/projects/org/demo/quota-explorer.git","targetRevision":"main"}]` | Liste des dépôts à déployer | | application.sourceReposPrefix | string | `"https://gitlab.com/projects/org/demo"` | Préfixe des dépôts autorisés | | argocd.namespace | string | `"argocd"` | Namespace de création des objets ArgoCD | | argocd.nsChartVersion | string | `"1.0.0"` | Version du Chart dso-ns à utiliser | diff --git a/charts/dso-env/templates/application-app.yaml b/charts/dso-env/templates/application-app.yaml index 87d31b6..25e3c8e 100644 --- a/charts/dso-env/templates/application-app.yaml +++ b/charts/dso-env/templates/application-app.yaml @@ -3,7 +3,7 @@ apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: {{ $.Values.argocd.project }}-app-{{ .name }} + name: {{ $.Values.argocd.project }}-{{ base .repoURL | trimSuffix ".git" }}-{{ sha1sum .repoURL | trunc 4 }} namespace: {{ $.Values.argocd.namespace }} labels: app.kubernetes.io/managed-by: dso-console diff --git a/charts/dso-env/values.yaml b/charts/dso-env/values.yaml index 104f5ab..9fefcc1 100644 --- a/charts/dso-env/values.yaml +++ b/charts/dso-env/values.yaml @@ -28,7 +28,6 @@ application: namespace: app1 # -- Liste des dépôts à déployer repositories: - - name: quota-explorer - repoURL: https://gitlab.com/projects/org/demo/quota-explorer.git + - repoURL: https://gitlab.com/projects/org/demo/quota-explorer.git targetRevision: main path: '.'