From b8470704713dca73789676705b75b0752c37bbf2 Mon Sep 17 00:00:00 2001
From: Dominik Hebeler <dominik@hebeler.club>
Date: Wed, 12 Jul 2023 10:44:14 +0200
Subject: [PATCH] variable agent name

---
 .gitlab/ci/build_docker_images.yml | 2 +-
 .gitlab/ci/deploy.yml              | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.gitlab/ci/build_docker_images.yml b/.gitlab/ci/build_docker_images.yml
index ef900cf73..56d2e3c8d 100644
--- a/.gitlab/ci/build_docker_images.yml
+++ b/.gitlab/ci/build_docker_images.yml
@@ -60,7 +60,7 @@ redis:
     KEEP_N: 9 # Trim to the latest 9 revisions as the 10th will be deleted in the next stage
   before_script:
     - kubectl config get-contexts
-    - kubectl config use-context open-source/MetaGer:metager
+    - kubectl config use-context $CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:metager
     - kubectl config view
   script:
     - .gitlab/deployment_scripts/cleanup_tags_revision.sh
diff --git a/.gitlab/ci/deploy.yml b/.gitlab/ci/deploy.yml
index b899436c5..1bfd85616 100644
--- a/.gitlab/ci/deploy.yml
+++ b/.gitlab/ci/deploy.yml
@@ -11,7 +11,7 @@
     COMMIT_NAME: $CI_COMMIT_REF_SLUG
   before_script:
     - kubectl config get-contexts
-    - kubectl config use-context open-source/MetaGer:metager
+    - kubectl config use-context $CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:metager
   script:
     - .gitlab/deployment_scripts/update_secret.sh
     - .gitlab/deployment_scripts/update_deployment.sh
@@ -76,7 +76,7 @@ stop_review:
     REDIS_REPOSITORY_ID: 425
   before_script:
     - kubectl config get-contexts
-    - kubectl config use-context open-source/MetaGer:metager
+    - kubectl config use-context $CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME:metager
   script:
     - .gitlab/deployment_scripts/delete_deployment.sh
   when: manual
-- 
GitLab