Skip to content

Commit

Permalink
ci: improvements (#964)
Browse files Browse the repository at this point in the history
* improvements for CI
  • Loading branch information
ypoplavs authored Nov 19, 2024
1 parent ee3ecc8 commit 87cc29b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -20,7 +20,7 @@ env:


jobs:
release_charts:
deploy_charts:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/helm-releaser-testkube-charts.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion scripts/chart_releaser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 87cc29b

Please sign in to comment.