From b17ea4392ee99d574ac682875f78aeb247722c3b Mon Sep 17 00:00:00 2001 From: Muhammad Saud Khan Date: Mon, 10 Jul 2023 11:07:36 +0200 Subject: [PATCH 1/3] feat: add helm upgrade workflow --- .github/workflows/helm-upgrade.yaml | 67 +++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/helm-upgrade.yaml diff --git a/.github/workflows/helm-upgrade.yaml b/.github/workflows/helm-upgrade.yaml new file mode 100644 index 000000000..48894f3dc --- /dev/null +++ b/.github/workflows/helm-upgrade.yaml @@ -0,0 +1,67 @@ +################################################################################# +# Catena-X - Product Passport Consumer Application +# +# Copyright (c) 2022, 2023 BASF SE, BMW AG, Henkel AG & Co. KGaA +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License, Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the +# License for the specific language govern in permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 +################################################################################# + +name: Upgrade Charts + +on: + push: + branches: [ "main", "develop", "feature/cmp-701/add-helm-upgrade-workflow" ] + workflow_dispatch: + inputs: + branch: + description: "Branch to use" + required: true + default: 'main' + type: string + +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Kubernetes KinD Cluster + uses: container-tools/kind-action@v2 + + - name: Set up Helm + uses: azure/setup-helm@v3 + with: + version: v3.9.3 + + - name: Add repos + run: | + helm repo add bitnami https://charts.bitnami.com/bitnami + helm repo add tractusx-dev https://eclipse-tractusx.github.io/charts/dev + + - name: Run helm install + # Install latest released digital-product-pass version + run: | + helm install dpp tractusx-dev/digital-product-pass + + - name: Run helm upgrade + # Upgrade the installed dpp version with the locally available charts + run: | + helm dependency update charts/digital-product-pass + helm upgrade dpp charts/digital-product-pass From 550ae09fdefb80529ff9ee2e1434e4b49942a319 Mon Sep 17 00:00:00 2001 From: Muhammad Saud Khan Date: Mon, 10 Jul 2023 11:12:37 +0200 Subject: [PATCH 2/3] chore: add namespace in helm-upgrade workflow --- .github/workflows/helm-upgrade.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-upgrade.yaml b/.github/workflows/helm-upgrade.yaml index 48894f3dc..9e833fc58 100644 --- a/.github/workflows/helm-upgrade.yaml +++ b/.github/workflows/helm-upgrade.yaml @@ -58,10 +58,10 @@ jobs: - name: Run helm install # Install latest released digital-product-pass version run: | - helm install dpp tractusx-dev/digital-product-pass + helm install dpp tractusx-dev/digital-product-pass -n product-material-pass --create-namespace - name: Run helm upgrade # Upgrade the installed dpp version with the locally available charts run: | helm dependency update charts/digital-product-pass - helm upgrade dpp charts/digital-product-pass + helm upgrade dpp charts/digital-product-pass -n product-material-pass From a19110427acf27dec6950d5d35fcf3b13d3dcfb4 Mon Sep 17 00:00:00 2001 From: Muhammad Saud Khan Date: Mon, 10 Jul 2023 11:17:38 +0200 Subject: [PATCH 3/3] chore: remove feature branch after successful tests for helm-upgrade.yaml --- .github/workflows/helm-upgrade.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/helm-upgrade.yaml b/.github/workflows/helm-upgrade.yaml index 9e833fc58..4c90d90d0 100644 --- a/.github/workflows/helm-upgrade.yaml +++ b/.github/workflows/helm-upgrade.yaml @@ -23,8 +23,9 @@ name: Upgrade Charts on: - push: - branches: [ "main", "develop", "feature/cmp-701/add-helm-upgrade-workflow" ] + pull_request: + paths: + - 'charts/digital-product-pass/**' workflow_dispatch: inputs: branch: @@ -34,8 +35,9 @@ on: type: string jobs: - lint-test: + upgrade: runs-on: ubuntu-latest + if: ${{ github.repository == 'eclipse-tractusx/digital-product-pass' }} steps: - name: Checkout code uses: actions/checkout@v3