From a806bc4f8e59c0bddec6f89aae914ebf1fda241e Mon Sep 17 00:00:00 2001
From: Remi  PLANEL <rplanel@pasteur.fr>
Date: Fri, 29 Mar 2024 15:56:26 +0100
Subject: [PATCH] remove protocole

---
 .gitlab-ci.yml                                       | 6 +++++-
 packages/df-wiki-cli/df_wiki_cli/meilisearch/main.py | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4a947922..617c752c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -360,12 +360,13 @@ update-meilisearch-index:prod:
   stage: get-meili-key
   variables:
     MEILI_HOST: "http://localhost:7700"
+    MEILI_HOST_NO_PROTOCOLE: "localhost:7700"
   script:
     - > 
       df-wiki-cli 
       meilisearch 
       --key "${MEILI_MASTER_KEY}" 
-      --host ${MEILI_HOST} 
+      --host ${MEILI_HOST_NO_PROTOCOLE} 
       get-env-var
       --output build.env
   artifacts:
@@ -378,6 +379,7 @@ set-meili-env:dev:
   extends: .set-meili-env
   variables:
     MEILI_HOST: "https://${MEILI_HOST_DEV}"
+    MEILI_HOST_NO_PROTOCOLE: ${MEILI_HOST_DEV}
   rules:
     - if: $CI_COMMIT_BRANCH != "main"  
 
@@ -385,6 +387,8 @@ set-meili-env:prod:
   extends: .set-meili-env
   variables:
     MEILI_HOST: "https://${MEILI_HOST_PROD}"
+    MEILI_HOST_NO_PROTOCOLE: ${MEILI_HOST_PROD}
+
   rules:
     - if: $CI_COMMIT_BRANCH == "main"  
 
diff --git a/packages/df-wiki-cli/df_wiki_cli/meilisearch/main.py b/packages/df-wiki-cli/df_wiki_cli/meilisearch/main.py
index 03196261..e1644c06 100644
--- a/packages/df-wiki-cli/df_wiki_cli/meilisearch/main.py
+++ b/packages/df-wiki-cli/df_wiki_cli/meilisearch/main.py
@@ -141,5 +141,5 @@ def get_env_var(
     if len(api_key) == 1:
         with open(output, "a") as outfile:
             print(ctx.obj.host)
-            outfile.write(f"MEILI_HOST='{ctx.obj.host}'\n")
+            outfile.write(f"MEILI_HOST={ctx.obj.host}\n")
             outfile.write(f"MEILI_API_KEY='{api_key[0]}'\n")
-- 
GitLab