From ef7d75ff1f9ac7f2ce02fced3db1549639fbd0fd Mon Sep 17 00:00:00 2001 From: Dominik Kaminski Date: Mon, 24 Jul 2023 20:13:20 +0200 Subject: [PATCH] feat(helmfile): Remove environments and replace with generic one --- .gitlab-ci.yml | 24 +++++++------------ helmfile/bases/environments.yaml | 8 +++---- .../{uv-develop => dev}/values.yaml | 5 ++-- .../environments/{ionos => prod}/values.yaml | 9 ++----- 4 files changed, 16 insertions(+), 30 deletions(-) rename helmfile/environments/{uv-develop => dev}/values.yaml (66%) rename helmfile/environments/{ionos => prod}/values.yaml (53%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e76983e3..80108087 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,10 @@ # SPDX-FileCopyrightText: 2023 Bundesministerium des Innern und für Heimat, PG ZenDiS "Projektgruppe für Aufbau ZenDiS" # SPDX-License-Identifier: Apache-2.0 --- +include: + - project: "souvap/devops/sovereign-workplace-env" + file: "gitlab/environments.yaml" + stages: - "env-cleanup" - "env" @@ -118,6 +122,7 @@ variables: .deploy-common: cache: {} dependencies: [] + extends: ".environments" image: "registry.souvap-univention.de/souvap/tooling/images/helm:latest" secrets: SMTP_PASSWORD: @@ -138,23 +143,8 @@ variables: file: false script: - cd "${CI_PROJECT_DIR}/helmfile/apps/${COMPONENT}" - - | - # Match Cluster to helmfile environments - if [ "${CLUSTER}" = "develop" ]; then - export HELMFILE_ENVIRONMENT=uv-develop - elif [ "${CLUSTER}" = "prototype" ]; then - export HELMFILE_ENVIRONMENT=uv-develop - elif [ "${CLUSTER}" = "hubble" ]; then - export HELMFILE_ENVIRONMENT=default - elif [ "${CLUSTER}" = "dev" ]; then - export HELMFILE_ENVIRONMENT=ionos - elif [ "${CLUSTER}" = "qa" ]; then - export HELMFILE_ENVIRONMENT=ionos - else - echo "Unsupported cluster chosen: ${CLUSTER}" - exit 1 - fi; # MASTER_PASSWORD_WEB_VAR as precedence for MASTER_PASSWORD + - | if ! [ -z "${MASTER_PASSWORD_WEB_VAR}" ]; then export MASTER_PASSWORD="${MASTER_PASSWORD_WEB_VAR}" fi; @@ -164,6 +154,8 @@ variables: - "docker" - "kubernetes" - "${CLUSTER}" + variables: + HELMFILE_ENVIRONMENT: "dev" env-cleanup: extends: ".deploy-common" diff --git a/helmfile/bases/environments.yaml b/helmfile/bases/environments.yaml index fe5d9da9..037b6b04 100644 --- a/helmfile/bases/environments.yaml +++ b/helmfile/bases/environments.yaml @@ -5,12 +5,12 @@ environments: default: values: - "../../environments/default/*.gotmpl" - ionos: + dev: values: - "../../environments/default/*.gotmpl" - - "../../environments/ionos/values.yaml" - uv-develop: + - "../../environments/dev/values.yaml" + prod: values: - "../../environments/default/*.gotmpl" - - "../../environments/uv-develop/values.yaml" + - "../../environments/prod/values.yaml" ... diff --git a/helmfile/environments/uv-develop/values.yaml b/helmfile/environments/dev/values.yaml similarity index 66% rename from helmfile/environments/uv-develop/values.yaml rename to helmfile/environments/dev/values.yaml index b8962094..c1a20286 100644 --- a/helmfile/environments/uv-develop/values.yaml +++ b/helmfile/environments/dev/values.yaml @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: 2023 Bundesministerium des Innern und für Heimat, PG ZenDiS "Projektgruppe für Aufbau ZenDiS" # SPDX-License-Identifier: Apache-2.0 --- -ingress: - ingressClassName: "nginx" - +# This a sample file and could be filled with proper variable overload. +sample: true ... diff --git a/helmfile/environments/ionos/values.yaml b/helmfile/environments/prod/values.yaml similarity index 53% rename from helmfile/environments/ionos/values.yaml rename to helmfile/environments/prod/values.yaml index 49e7f881..c1a20286 100644 --- a/helmfile/environments/ionos/values.yaml +++ b/helmfile/environments/prod/values.yaml @@ -1,11 +1,6 @@ # SPDX-FileCopyrightText: 2023 Bundesministerium des Innern und für Heimat, PG ZenDiS "Projektgruppe für Aufbau ZenDiS" # SPDX-License-Identifier: Apache-2.0 --- -ingress: - ingressClassName: "dedicated-haproxy-external" - -persistence: - storageClassNames: - RWX: "nfs-client" - RWO: "ionos-enterprise-ssd" +# This a sample file and could be filled with proper variable overload. +sample: true ...