From abec5bc8f11311daf903ee938f6f2a1f9b9d4de2 Mon Sep 17 00:00:00 2001
From: Remi  PLANEL <rplanel@pasteur.fr>
Date: Mon, 6 Nov 2023 14:46:58 +0100
Subject: [PATCH] specific dev conf deploy to values.development.yaml

---
 .gitlab-ci.yml                         | 24 ++++++++++++++----------
 deploy/df-wiki/values.development.yaml | 14 ++++++++++++++
 deploy/df-wiki/values.production.yaml  | 17 +++++++++++++++++
 3 files changed, 45 insertions(+), 10 deletions(-)
 create mode 100644 deploy/df-wiki/values.development.yaml
 create mode 100644 deploy/df-wiki/values.production.yaml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e2cc9203..bce3b19f 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -109,6 +109,17 @@ build:dev:
   rules:
     - if: $CI_COMMIT_BRANCH != "main"
 
+
+build:prod:
+  extends: .build
+  variables:
+    BASE_URL: /wiki/
+    MEILI_HOST: 'https://defense-finder-meilisearch.dev.pasteur.cloud'
+    MEILI_API_KEY: MASTER_KEY
+  rules:
+    - if: $CI_COMMIT_BRANCH == "main"
+
+
 .deploy:
   stage: deploy
   image: harbor.pasteur.fr/kube-system/helm-kubectl:$HELM_VERSION
@@ -125,17 +136,15 @@ build:dev:
       --set registry.username=${DEPLOY_USER}
       --set registry.password=${DEPLOY_TOKEN}
       --set registry.host=${CI_REGISTRY}
-      --set ingress.enabled="false"
       --set ingress.hosts[0].host="${PUBLIC_URL}"
       --set ingress.hosts[0].paths[0].path="/wiki"
       --set ingress.hosts[0].paths[0].pathType="Prefix"
-      --set ingress.annotations."kubernetes\.io/ingress\.class"="$INGRESS_CLASS"
       --set imagePullSecrets[0].name="registry-pull-secret-${CI_COMMIT_REF_SLUG}"
       --set image.repository="$CI_REGISTRY_IMAGE/$IMAGE_NAME"
       --set image.tag="$CI_COMMIT_SHORT_SHA"
-      --set image.pullPolicy='Always'
-      --set strategy.type="${DEPLOY_STRATEGY}"
-      --set env="$ENV"
+      --set env="${ENV:-development}"
+      --values values.yaml
+      --values values.${ENV:-development}.yaml
 
 deploy:dev:
   extends: .deploy
@@ -148,11 +157,6 @@ deploy:dev:
     NODE_ENV: "development"
     KUBE_NAMESPACE: "defense-finder-dev"
     PUBLIC_URL: "defense-finder.dev.pasteur.cloud"
-    INGRESS_CLASS: "internal"
-    AUTOSCALE: "true"
-    AUTSCALING_MIN_REPLICAS: "1"
-    AUTSCALING_MAX_REPLICAS: "4"
-    DEPLOY_STRATEGY: "Recreate"
     ENV: "development"
   environment:
     name: k8sdev-01
diff --git a/deploy/df-wiki/values.development.yaml b/deploy/df-wiki/values.development.yaml
new file mode 100644
index 00000000..719e6d53
--- /dev/null
+++ b/deploy/df-wiki/values.development.yaml
@@ -0,0 +1,14 @@
+image:
+  pullPolicy: Always
+
+ingress:
+  enabled: false
+  annotations:
+    - kubernetes.io/ingress.class: internal
+  hosts:
+    - host: chart-example.local
+      paths:
+        - path: /wiki
+          pathType: Prefix
+strategy:
+  type: Recreate
\ No newline at end of file
diff --git a/deploy/df-wiki/values.production.yaml b/deploy/df-wiki/values.production.yaml
new file mode 100644
index 00000000..8cff37f6
--- /dev/null
+++ b/deploy/df-wiki/values.production.yaml
@@ -0,0 +1,17 @@
+ingress:
+  enabled: false
+  className: ""
+  annotations:
+    - kubernetes.io/ingress.class: internal
+    # nginx.ingress.kubernetes.io/rewrite-target: /$2
+    # kubernetes.io/ingress.class: nginx
+    # kubernetes.io/tls-acme: "true"
+  hosts:
+    - host: chart-example.local
+      paths:
+        - path: /wiki
+          pathType: Prefix
+  tls: []
+  #  - secretName: chart-example-tls
+  #    hosts:
+  #      - chart-example.local
-- 
GitLab