From 6a252fe10d402150c47fe599300d2b57677acc93 Mon Sep 17 00:00:00 2001
From: Jakob Probst <jakob.probst@h-da.de>
Date: Fri, 16 Aug 2024 21:37:58 +0200
Subject: [PATCH] chore: use the new templates and utilities components

---
 .gitlab-ci.yml                                  | 17 ++++++++---------
 helm/bbbatscale-support-notify/Chart.yaml       |  6 +++---
 .../templates/image-pull-secret.yaml            |  2 +-
 helmfile.yaml.gotmpl                            |  6 ++++--
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2727ec8..512d190 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,10 +6,12 @@ variables:
   BBBATSCALE_SUPPORT_NOTIFY_IMAGE: $CI_REGISTRY_IMAGE/bbbatscale-support-notify
 
 include:
-  - project: its/infra-utils
-    file: gitlab/ci/templates/get-openshift-kubeconfig.gitlab-ci.yml
-  - project: its/infra-utils
-    file: gitlab/ci/templates/install-helmfile.gitlab-ci.yml
+  - component: $CI_SERVER_FQDN/its/templates-and-utilities/gitlab-ci-components/manage-namespaces-and-service-accounts/download-kubeconfig@1
+    inputs:
+      project-full-path: its/openshift
+      namespace: rooms
+      service-account: bbbatscale-support-notify-admin
+  - component: $CI_SERVER_FQDN/its/templates-and-utilities/gitlab-ci-components/install-helmfile/install-helmfile@1
 
 build:
   stage: build
@@ -33,12 +35,9 @@ deploy:
     name: alpine
   rules:
     - when: manual
-  variables:
-    NAMESPACE: rooms
-    SERVICE_ACCOUNT: bbbatscale-support-notify-admin
   before_script:
-    - !reference [ .get openshift kubeconfig - alpine, before_script ]
-    - !reference [ .install helmfile - alpine, before_script ]
+    - !reference [ .download-kubeconfig-alpine , before_script ]
+    - !reference [ .install-helmfile-alpine, before_script ]
   script:
     - helmfile sync --file "$CI_PROJECT_DIR/helmfile.yaml.gotmpl"
   needs:
diff --git a/helm/bbbatscale-support-notify/Chart.yaml b/helm/bbbatscale-support-notify/Chart.yaml
index 2fc69fd..130050d 100644
--- a/helm/bbbatscale-support-notify/Chart.yaml
+++ b/helm/bbbatscale-support-notify/Chart.yaml
@@ -6,6 +6,6 @@ type: application
 version: 0.0.0
 
 dependencies:
-  - name: its-infra-utils
-    version: 0.0.0
-    repository: git+https://code.fbi.h-da.de/its/infra-utils.git@charts?ref=main
+  - name: docker-config
+    version: ^2.0.0
+    repository: https://code.fbi.h-da.de/api/v4/projects/36536/packages/helm/stable
diff --git a/helm/bbbatscale-support-notify/templates/image-pull-secret.yaml b/helm/bbbatscale-support-notify/templates/image-pull-secret.yaml
index c9feedd..a8ed1ee 100644
--- a/helm/bbbatscale-support-notify/templates/image-pull-secret.yaml
+++ b/helm/bbbatscale-support-notify/templates/image-pull-secret.yaml
@@ -7,5 +7,5 @@ metadata:
     {{- include "bbbatscale-support-notify.labels" . | nindent 4 }}
 type: kubernetes.io/dockerconfigjson
 data:
-  .dockerconfigjson: {{ include "its-infra-utils.dockerConfig" .Values.imagePullConfig | b64enc }}
+  .dockerconfigjson: {{ include "de.h-da.fbi.docker-config.dockerConfig" .Values.imagePullConfig | b64enc }}
 {{- end }}
diff --git a/helmfile.yaml.gotmpl b/helmfile.yaml.gotmpl
index ef4c840..1d60d1a 100644
--- a/helmfile.yaml.gotmpl
+++ b/helmfile.yaml.gotmpl
@@ -1,6 +1,8 @@
 repositories:
-  - name: its-infra-utils
-    url: git+https://code.fbi.h-da.de/its/infra-utils.git@charts?ref=main
+  - name: docker-config
+    url: https://code.fbi.h-da.de/api/v4/projects/36536/packages/helm/stable
+    username: gitlab-ci-token
+    password: {{ requiredEnv "CI_JOB_TOKEN" | quote }}
 
 missingFileHandler: Error
 
-- 
GitLab