diff --git a/.github/workflows/helm-deploy-testkube-charts-develop-commit.yaml b/.github/workflows/helm-deploy-testkube-charts-develop-commit.yaml index 55584885b..c3a0ef010 100644 --- a/.github/workflows/helm-deploy-testkube-charts-develop-commit.yaml +++ b/.github/workflows/helm-deploy-testkube-charts-develop-commit.yaml @@ -1,4 +1,4 @@ -name: Releasing Testkube Helm charts to Develop k8s Cluster on commit to develop +name: Deploying Testkube Helm charts to Develop k8s Cluster on commit to develop concurrency: develop_cluster @@ -20,7 +20,7 @@ env: jobs: - release_charts: + deploy_charts: runs-on: ubuntu-latest steps: - name: Checkout @@ -65,13 +65,13 @@ jobs: notify_slack_if_deploy_succeeds: runs-on: ubuntu-latest - needs: release_charts + needs: deploy_charts steps: - name: Slack Notification if the helm release deployment to ${{ env.ENV }} GKS succeeded. uses: rtCamp/action-slack-notify@v2 env: SLACK_CHANNEL: testkube-logs - SLACK_COLOR: ${{ needs.release_charts.result }} # or a specific color like 'good' or '#ff00ff' + SLACK_COLOR: ${{ needs.deploy_charts.result }} # or a specific color like 'good' or '#ff00ff' SLACK_ICON: https://github.com/rtCamp.png?size=48 SLACK_TITLE: Helm chart release successfully deployed into ${{ secrets.GKE_CLUSTER_NAME }} GKE :party_blob:! SLACK_USERNAME: GitHub @@ -81,14 +81,14 @@ jobs: notify_slack_if_deploy_failed: runs-on: ubuntu-latest - needs: release_charts - if: always() && (needs.release_charts.result == 'failure') + needs: deploy_charts + if: always() && (needs.deploy_charts.result == 'failure') steps: - name: Slack Notification if the helm release deployment to ${{ env.ENV }} GKS failed. uses: rtCamp/action-slack-notify@v2 env: SLACK_CHANNEL: testkube-logs - SLACK_COLOR: ${{ needs.release_charts.result }} # or a specific color like 'good' or '#ff00ff' + SLACK_COLOR: ${{ needs.deploy_charts.result }} # or a specific color like 'good' or '#ff00ff' SLACK_ICON: https://github.com/rtCamp.png?size=48 SLACK_TITLE: Helm chart release failed to deploy into ${{ secrets.GKE_CLUSTER_NAME }} GKE! :boom:! SLACK_USERNAME: GitHub @@ -99,7 +99,7 @@ jobs: test_suite_run: name: test suite for GKE cluster runs-on: ubuntu-latest - needs: release_charts + needs: deploy_charts steps: # Setup gcloud CLI - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 diff --git a/.github/workflows/helm-releaser-testkube-charts.yaml b/.github/workflows/helm-releaser-testkube-charts.yaml index 2e2409e3d..c4553abf4 100644 --- a/.github/workflows/helm-releaser-testkube-charts.yaml +++ b/.github/workflows/helm-releaser-testkube-charts.yaml @@ -1,20 +1,14 @@ name: Releasing Helm charts. -concurrency: develop_cluster - on: - push: - paths: - - "charts/testkube/Chart.yaml" - - "charts/testkube-api/Chart.yaml" - - "charts/testkube-operator/Chart.yaml" - branches: - - main + repository_dispatch: + types: + [release-testkube-api-charts, release-testkube-operator-charts] env: PROJECT_ID: ${{ secrets.GKE_PROJECT }} - GKE_CLUSTER_NAME: ${{ secrets.GKE_CLUSTER_NAME_DEVELOP }} # Add your cluster name here. - GKE_ZONE: ${{ secrets.GKE_ZONE_DEVELOP }} # Add your cluster zone here. + GKE_CLUSTER_NAME: ${{ secrets.GKE_CLUSTER_NAME_DEVELOP }} + GKE_ZONE: ${{ secrets.GKE_ZONE_DEVELOP }} jobs: release_charts: @@ -41,6 +35,14 @@ jobs: helm repo add helm-charts https://kubeshop.github.io/helm-charts helm repo add bitnami https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami + - name: Update main Chart.yaml + run: | + export RELEASE_VERSION=${{ github.event.client_payload.RELEASE_VERSION }} + + cd ./scripts + chmod +x main_chart_releaser.sh + ./chart_releaser.sh --helm-chart-folder testkube-${{ github.event.client_payload.SERVICE }} + - name: Run chart-releaser uses: helm/chart-releaser-action@v1.6.0 with: diff --git a/scripts/chart_releaser.sh b/scripts/chart_releaser.sh index 02f542067..f850a2abc 100755 --- a/scripts/chart_releaser.sh +++ b/scripts/chart_releaser.sh @@ -73,6 +73,6 @@ grep -iE "^version" ../charts/testkube/Chart.yaml ## Commiting and pushing changes to main git add -A -git commit -m "Tag: $VERSION_FULL; $target_folder CI/CD. Bumped helm chart, app and docker image tag versions." +git commit -m "Tag: $VERSION_FULL; $target_folder docker image was updated; bumping chart versions." git push --set-upstream https://kubeshop-bot:$GH_TOKEN@github.com/kubeshop/helm-charts main