From 138409a09c1e4a92be399cabc1cf2a12e21f3fa2 Mon Sep 17 00:00:00 2001
From: Bryan Brancotte <bryan.brancotte@pasteur.fr>
Date: Wed, 15 Jun 2022 16:00:19 +0200
Subject: [PATCH] deploy release branch into production k8s

---
 .gitlab-ci.yml | 16 ++++++++++++++++
 README.md      |  4 +++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 68378691..34b40d7b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -180,6 +180,22 @@ deploy-dev:
     on_stop: delete-dev-deployment
 
 
+deploy-prod:
+  stage: deploy
+  needs:
+    - "test-pg"
+  extends: .deploy
+  only:
+    - release
+  variables:
+    NAMESPACE: "ippidb-prod"
+    PUBLIC_URL: "ippidb-internal.pasteur.cloud"
+    INGRESS_CLASS: "internal"
+  environment:
+    name: "k8sprod-02/ippidb-prod/${CI_COMMIT_REF_SLUG}"
+    url: "https://ippidb-internal.pasteur.cloud"
+
+
 delete-dev-deployment:
   stage: deploy
   needs: []
diff --git a/README.md b/README.md
index a82ec094..33d4490b 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,9 @@ ln -s ippisite/.flake8 .flake8
 ## Copy data to helm container
 ```shell
 # the first time, create a context, safer and easier than specifying the namespace a each command
-kubectl config set-context ippidb-dev --cluster=k8sdev-01 --user=$USER@k8sdev-01 --namespace ippidb-dev
+export K8S_USER=$USER
+kubectl config set-context ippidb-dev --cluster=k8sdev-01 --user=$K8S_USER@k8sdev-01 --namespace ippidb-dev
+kubectl config set-context ippidb-prod --cluster=k8sprod-02 --user=$K8S_USER@k8sprod-02 --namespace ippidb-prod
 ```
 
 ```shell
-- 
GitLab