From 2306d68afc754d7d7f925e97234b99cd87a3252a Mon Sep 17 00:00:00 2001 From: ypoplavs Date: Tue, 8 Oct 2024 11:51:32 +0300 Subject: [PATCH] Update CI --- .github/workflows/dispatch-develop-push.yaml | 2 +- ...deploy-testkube-charts-develop-commit.yaml | 2 +- .../helm-deploy-testkube-charts-develop.yaml | 4 +- ...m-deploy-testkube-charts-stage-commit.yaml | 201 ----------------- .../helm-deploy-testkube-charts-stage.yaml | 208 ------------------ .../helm-releaser-testkube-charts.yaml | 19 +- ...elm-releaser-testkube-main-chart-only.yaml | 10 +- 7 files changed, 18 insertions(+), 428 deletions(-) delete mode 100644 .github/workflows/helm-deploy-testkube-charts-stage-commit.yaml delete mode 100644 .github/workflows/helm-deploy-testkube-charts-stage.yaml diff --git a/.github/workflows/dispatch-develop-push.yaml b/.github/workflows/dispatch-develop-push.yaml index 90d563fbd..72bc1118a 100644 --- a/.github/workflows/dispatch-develop-push.yaml +++ b/.github/workflows/dispatch-develop-push.yaml @@ -3,7 +3,7 @@ name: Dispatch events based on develop push on: push: branches: - - develop + - main jobs: dispatch: diff --git a/.github/workflows/helm-deploy-testkube-charts-develop-commit.yaml b/.github/workflows/helm-deploy-testkube-charts-develop-commit.yaml index d831679b2..482d91a90 100644 --- a/.github/workflows/helm-deploy-testkube-charts-develop-commit.yaml +++ b/.github/workflows/helm-deploy-testkube-charts-develop-commit.yaml @@ -5,7 +5,7 @@ concurrency: develop_cluster on: push: branches: - - develop + - main repository_dispatch: types: diff --git a/.github/workflows/helm-deploy-testkube-charts-develop.yaml b/.github/workflows/helm-deploy-testkube-charts-develop.yaml index 46c28cbfa..6f026ef80 100644 --- a/.github/workflows/helm-deploy-testkube-charts-develop.yaml +++ b/.github/workflows/helm-deploy-testkube-charts-develop.yaml @@ -150,7 +150,7 @@ jobs: kubectl testkube create test -f ./test/postman/TestKube-Sanity.postman_collection.json --name sanity --type postman/collection -v api_uri=http://testkube-api-server:8088 -v test_api_uri=http://testkube-api-server:8088 -v test_type=postman/collection -v test_name=fill-me -v execution_name=fill-me - name: Run Postman sanity tests - run: kubectl testkube run test sanity -f --git-branch develop + run: kubectl testkube run test sanity -f --git-branch main - name: (Re)create Dashboard E2E tests (from CRD) working-directory: ./testkube-repo @@ -169,7 +169,7 @@ jobs: kubectl testkube create testsuite -f ./test/suites/staging-testsuite.json --name staging-testsuite - name: Run staging testsuite - run: kubectl testkube run testsuite staging-testsuite -f --git-branch develop + run: kubectl testkube run testsuite staging-testsuite -f --git-branch main notify_slack_if_test_suite_succeeds: runs-on: ubuntu-latest diff --git a/.github/workflows/helm-deploy-testkube-charts-stage-commit.yaml b/.github/workflows/helm-deploy-testkube-charts-stage-commit.yaml deleted file mode 100644 index 762784b6d..000000000 --- a/.github/workflows/helm-deploy-testkube-charts-stage-commit.yaml +++ /dev/null @@ -1,201 +0,0 @@ -name: Releasing Testkube Helm charts to Stage k8s Cluster. - -concurrency: develop_cluster - -on: - push: - paths: - - "charts/testkube/values-stage.yaml" - branches: - - develop - -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. - DEPLOYMENT_NAME: testkube-integration # Add your deployment name here. - ENV: stage - - -jobs: - release_charts_if_image_updated: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: ${{ github.event.client_payload.ref }} - - - name: Configure Git - run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 - with: - service_account_key: ${{ secrets.GKE_SA_KEY }} - project_id: ${{ secrets.GKE_PROJECT }} - - run: |- - gcloud --quiet auth configure-docker - - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ env.GKE_CLUSTER_NAME }} - location: ${{ env.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: Install Helm - uses: azure/setup-helm@v3 - with: - version: v3.10.0 - - - name: Installing repositories - run: | - helm repo add bitnami https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami - - - name: Get image tag of Testkube APi, Operator - id: vars - run: | - echo ::set-output name=api_image_tag::$(kubectl get deployment testkube-api-server -o=jsonpath='{$.spec.template.spec.containers[:1].image}' -n ${{ env.DEPLOYMENT_NAME }} | awk -F':' '{print $2}') || exit 1 - echo ::set-output name=operator_image_tag::$(kubectl get deployment testkube-operator-controller-manager -o=jsonpath='{$.spec.template.spec.containers[1].image}' -n testkube | awk -F':' '{print $2}') || exit 1 - - - name: Deploy helm chart to Develop Cluster - run: | - helm dependency update ./charts/testkube - helm upgrade --debug --install --atomic --timeout 180s testkube ./charts/testkube --namespace ${{ env.DEPLOYMENT_NAME }} --create-namespace --values ./charts/testkube/values-${{ env.ENV }}.yaml --set testkube-operator.image.tag=${{ steps.vars.outputs.operator_image_tag }} --set testkube-logs.image.tag=${{ steps.vars.outputs.api_image_tag }} --set testkube-api.image.tag=${{ steps.vars.outputs.api_image_tag }} --set testkube-api.multinamespace.enabled=true --set testkube-operator.enabled=false - - notify_slack_if_deploy_stage_succeeds: - runs-on: ubuntu-latest - needs: release_charts_if_image_updated - steps: - - name: Slack Notification if the helm release deployment to ${{ env.GKE_CLUSTER_NAME }} GKE into ${{ env.DEPLOYMENT_NAME }} namespace succeeded. - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: testkube-logs - SLACK_COLOR: ${{ needs.release_charts_if_image_updated.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 to ${{ env.GKE_CLUSTER_NAME }} GKE into ${{ env.DEPLOYMENT_NAME }} namespace :party_blob:! - SLACK_USERNAME: GitHub - SLACK_LINK_NAMES: true - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_FOOTER: "Kubeshop --> TestKube" - - notify_slack_if_deploy_stage_failed: - runs-on: ubuntu-latest - needs: release_charts_if_image_updated - if: always() && (needs.release_charts_if_image_updated.result == 'failure') - steps: - - name: Slack Notification if the helm release deployment to ${{ env.GKE_CLUSTER_NAME }} GKE into ${{ env.DEPLOYMENT_NAME }} namespace failed. - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: testkube-logs - SLACK_COLOR: ${{ needs.release_charts_if_image_updated.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 to ${{ env.GKE_CLUSTER_NAME }} GKE into ${{ env.DEPLOYMENT_NAME }} namespace :boom:! - SLACK_USERNAME: GitHub - SLACK_LINK_NAMES: true - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_FOOTER: "Kubeshop --> TestKube" - - test_suite_run: - name: test suite for GKE cluster - runs-on: ubuntu-latest - needs: release_charts_if_image_updated - steps: - # Setup gcloud CLI - - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 - with: - service_account_key: ${{ secrets.GKE_SA_KEY }} - project_id: ${{ secrets.GKE_PROJECT }} - - # Configure Docker to use the gcloud command-line tool as a credential - # helper for authentication - - run: |- - gcloud --quiet auth configure-docker - - # Get the GKE credentials so we can deploy to the cluster - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ env.GKE_CLUSTER_NAME }} - location: ${{ env.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: Install testkube kubectl plugin and disable telemetry - run: bash <(curl -sSLf https://get.testkube.io) beta && kubectl testkube disable telemetry --namespace ${{ env.DEPLOYMENT_NAME }} - - - name: Checkout tests from main Testkube repo - uses: actions/checkout@v3 - with: - repository: kubeshop/testkube - path: testkube-repo - - - name: Executor tests - delete/create/schedule all executor tests - working-directory: ./testkube-repo - run: chmod +x ./test/scripts/executor-tests/run.sh && ./test/scripts/executor-tests/run.sh -d -c -s -n ${{ env.DEPLOYMENT_NAME }} # (delete, create, schedule) - don't execute - - - name: (Re)create Postman Sanity test (with CLI) - working-directory: ./testkube-repo - run: |- - # enabling debug mode - set -x - kubectl delete test sanity --ignore-not-found=true --namespace ${{ env.DEPLOYMENT_NAME }} - kubectl delete secret sanity-secrets --ignore-not-found=true --namespace ${{ env.DEPLOYMENT_NAME }} - kubectl testkube create test -f ./test/postman/TestKube-Sanity.postman_collection.json --name sanity --type postman/collection -v api_uri=http://testkube-api-server:8088 -v test_api_uri=http://testkube-api-server:8088 -v test_type=postman/collection -v test_name=fill-me -v execution_name=fill-me --namespace ${{ env.DEPLOYMENT_NAME }} - - - name: Run Postman sanity tests - run: kubectl testkube run test sanity -f --git-branch develop --namespace ${{ env.DEPLOYMENT_NAME }} - - - name: (Re)create Dashboard E2E tests (from CRD) - working-directory: ./testkube-repo - run: |- - # enabling debug mode - set -x - kubectl delete test dashboard-e2e-tests --ignore-not-found=true --namespace ${{ env.DEPLOYMENT_NAME }} - kubectl apply -f ./test/dashboard-e2e/crd/crd.yaml --namespace ${{ env.DEPLOYMENT_NAME }} - - - name: (Re)create staging testsuite (executor tests) - working-directory: ./testkube-repo - run: |- - # enabling debug mode - set -x - kubectl delete testsuite staging-testsuite --ignore-not-found=true --namespace ${{ env.DEPLOYMENT_NAME }} - kubectl testkube create testsuite -f ./test/suites/staging-testsuite.json --name staging-testsuite --namespace ${{ env.DEPLOYMENT_NAME }} - - - name: Run Executor tests - run: kubectl testkube run testsuite staging-testsuite -f --git-branch develop --namespace ${{ env.DEPLOYMENT_NAME }} - - - name: Run Dashboard E2E tests - run: kubectl testkube run test dashboard-e2e-tests -f --variable TESTKUBE_NAMESPACE=${{ env.DEPLOYMENT_NAME }} --namespace ${{ env.DEPLOYMENT_NAME }} - - notify_slack_if_test_suite_stage_succeeds: - runs-on: ubuntu-latest - needs: test_suite_run - steps: - - name: Slack Notification if the test suite run on ${{ env.GKE_CLUSTER_NAME }} GKE in ${{ env.DEPLOYMENT_NAME }} namespace succeeded. - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: testkube-logs - SLACK_COLOR: ${{ needs.test_suite_run.result }} # or a specific color like 'good' or '#ff00ff' - SLACK_ICON: https://github.com/rtCamp.png?size=48 - SLACK_TITLE: Test suite successfully run on ${{ env.GKE_CLUSTER_NAME }} GKE in ${{ env.DEPLOYMENT_NAME }} namespace :party_blob:! - SLACK_USERNAME: GitHub - SLACK_LINK_NAMES: true - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_FOOTER: "Kubeshop --> TestKube" - - notify_slack_if_test_suite_failed: - runs-on: ubuntu-latest - needs: test_suite_run - if: always() && (needs.test_suite_run.result == 'failure') - steps: - - name: Slack Notification if the test suite run on ${{ env.GKE_CLUSTER_NAME }} GKE in ${{ env.DEPLOYMENT_NAME }} namespace failed. - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: testkube-logs - SLACK_COLOR: ${{ needs.test_suite_run.result }} # or a specific color like 'good' or '#ff00ff' - SLACK_ICON: https://github.com/rtCamp.png?size=48 - SLACK_TITLE: Test suite FAILED to run on ${{ env.GKE_CLUSTER_NAME }} GKE in ${{ env.DEPLOYMENT_NAME }} namespace! :boom:! - SLACK_USERNAME: GitHub - SLACK_LINK_NAMES: true - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_FOOTER: "Kubeshop --> TestKube" \ No newline at end of file diff --git a/.github/workflows/helm-deploy-testkube-charts-stage.yaml b/.github/workflows/helm-deploy-testkube-charts-stage.yaml deleted file mode 100644 index d109334a2..000000000 --- a/.github/workflows/helm-deploy-testkube-charts-stage.yaml +++ /dev/null @@ -1,208 +0,0 @@ -name: Releasing Testkube Helm charts to Stage k8s Cluster. - -concurrency: develop_cluster - -on: - repository_dispatch: - types: - [ - trigger-workflow-api-release, - trigger-workflow-operator-release, - ] - -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. - DEPLOYMENT_NAME: testkube-integration # Add your deployment name here. - ENV: stage - -jobs: - release_charts_if_image_updated: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: ${{ github.event.client_payload.ref }} - - - name: Configure Git - run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 - with: - service_account_key: ${{ secrets.GKE_SA_KEY }} - project_id: ${{ secrets.GKE_PROJECT }} - - run: |- - gcloud --quiet auth configure-docker - - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ env.GKE_CLUSTER_NAME }} - location: ${{ env.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: Install Helm - uses: azure/setup-helm@v3 - with: - version: v3.10.0 - - - name: Installing repositories - run: | - helm repo add bitnami https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami - - - name: Get image tag of Testkube APi, Operator - id: vars - run: | - echo ::set-output name=api_image_tag::$(kubectl get deployment testkube-api-server -o=jsonpath='{$.spec.template.spec.containers[:1].image}' -n ${{ env.DEPLOYMENT_NAME }} | awk -F':' '{print $2}') || exit 1 - echo ::set-output name=operator_image_tag::$(kubectl get deployment testkube-operator-controller-manager -o=jsonpath='{$.spec.template.spec.containers[1].image}' -n testkube | awk -F':' '{print $2}') || exit 1 - - - name: Deploy if Testkube API image is updated - if: ${{ github.event.client_payload.image_tag_api }} - run: | - helm dependency update ./charts/testkube - helm upgrade --debug --install --atomic --timeout 180s testkube ./charts/testkube --namespace ${{ env.DEPLOYMENT_NAME }} --create-namespace --values ./charts/testkube/values-${{ env.ENV }}.yaml --set testkube-api.image.tag=${{ github.event.client_payload.image_tag_api }} --set testkube-logs.image.tag=${{ github.event.client_payload.image_tag_api }} --set testkube-operator.image.tag=${{ steps.vars.outputs.operator_image_tag }} --set testkube-api.multinamespace.enabled=true --set testkube-operator.enabled=false --set mongodb.livenessProbe.enabled=false --set mongodb.readinessProbe.enabled=false - - - name: Deploy if Testkube Operator image is updated - if: ${{ github.event.client_payload.image_tag_operator }} - run: | - helm dependency update ./charts/testkube - helm upgrade --debug --install --atomic --timeout 180s testkube ./charts/testkube --namespace ${{ env.DEPLOYMENT_NAME }} --create-namespace --values ./charts/testkube/values-${{ env.ENV }}.yaml --set testkube-operator.image.tag=${{ github.event.client_payload.image_tag_operator }} --set testkube-api.image.tag=${{ steps.vars.outputs.api_image_tag }} --set testkube-logs.image.tag=${{ steps.vars.outputs.api_image_tag }} --set testkube-api.multinamespace.enabled=true --set testkube-operator.enabled=false --set mongodb.livenessProbe.enabled=false --set mongodb.readinessProbe.enabled=false - - notify_slack_if_deploy_stage_succeeds: - runs-on: ubuntu-latest - needs: release_charts_if_image_updated - steps: - - name: Slack Notification if the helm release deployment to ${{ env.GKE_CLUSTER_NAME }} GKE into ${{ env.DEPLOYMENT_NAME }} namespace succeeded. - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: testkube-logs - SLACK_COLOR: ${{ needs.release_charts_if_image_updated.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 to ${{ env.GKE_CLUSTER_NAME }} GKE into ${{ env.DEPLOYMENT_NAME }} namespace :party_blob:! - SLACK_USERNAME: GitHub - SLACK_LINK_NAMES: true - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_FOOTER: "Kubeshop --> TestKube" - - notify_slack_if_deploy_stage_failed: - runs-on: ubuntu-latest - needs: release_charts_if_image_updated - if: always() && (needs.release_charts_if_image_updated.result == 'failure') - steps: - - name: Slack Notification if the helm release deployment to ${{ env.GKE_CLUSTER_NAME }} GKE into ${{ env.DEPLOYMENT_NAME }} namespace failed. - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: testkube-logs - SLACK_COLOR: ${{ needs.release_charts_if_image_updated.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 to ${{ env.GKE_CLUSTER_NAME }} GKE into ${{ env.DEPLOYMENT_NAME }} namespace :boom:! - SLACK_USERNAME: GitHub - SLACK_LINK_NAMES: true - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_FOOTER: "Kubeshop --> TestKube" - - test_suite_run: - name: test suite for GKE cluster - runs-on: ubuntu-latest - needs: release_charts_if_image_updated - steps: - # Setup gcloud CLI - - uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7 - with: - service_account_key: ${{ secrets.GKE_SA_KEY }} - project_id: ${{ secrets.GKE_PROJECT }} - - # Configure Docker to use the gcloud command-line tool as a credential - # helper for authentication - - run: |- - gcloud --quiet auth configure-docker - - # Get the GKE credentials so we can deploy to the cluster - - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e - with: - cluster_name: ${{ env.GKE_CLUSTER_NAME }} - location: ${{ env.GKE_ZONE }} - credentials: ${{ secrets.GKE_SA_KEY }} - - - name: Install testkube kubectl plugin and disable telemetry - run: bash <(curl -sSLf https://get.testkube.io) beta && kubectl testkube disable telemetry --namespace ${{ env.DEPLOYMENT_NAME }} - - - name: Checkout tests from main Testkube repo - uses: actions/checkout@v3 - with: - repository: kubeshop/testkube - path: testkube-repo - - - name: Executor tests - delete/create/schedule all executor tests - working-directory: ./testkube-repo - run: chmod +x ./test/scripts/executor-tests/run.sh && ./test/scripts/executor-tests/run.sh -d -c -s -n ${{ env.DEPLOYMENT_NAME }} # (delete, create, schedule) - don't execute - - - name: (Re)create Postman Sanity test (with CLI) - working-directory: ./testkube-repo - run: |- - # enabling debug mode - set -x - kubectl delete test sanity --ignore-not-found=true --namespace ${{ env.DEPLOYMENT_NAME }} - kubectl delete secret sanity-secrets --ignore-not-found=true --namespace ${{ env.DEPLOYMENT_NAME }} - kubectl testkube create test -f ./test/postman/TestKube-Sanity.postman_collection.json --name sanity --type postman/collection -v api_uri=http://testkube-api-server:8088 -v test_api_uri=http://testkube-api-server:8088 -v test_type=postman/collection -v test_name=fill-me -v execution_name=fill-me --namespace ${{ env.DEPLOYMENT_NAME }} - - - name: Run Postman sanity tests - run: kubectl testkube run test sanity -f --git-branch develop --namespace ${{ env.DEPLOYMENT_NAME }} - - - name: (Re)create Dashboard E2E tests (from CRD) - working-directory: ./testkube-repo - run: |- - # enabling debug mode - set -x - kubectl delete test dashboard-e2e-tests --ignore-not-found=true --namespace ${{ env.DEPLOYMENT_NAME }} - kubectl apply -f ./test/dashboard-e2e/crd/crd.yaml --namespace ${{ env.DEPLOYMENT_NAME }} - - - name: (Re)create staging testsuite (executor tests) - working-directory: ./testkube-repo - run: |- - # enabling debug mode - set -x - kubectl delete testsuite staging-testsuite --ignore-not-found=true --namespace ${{ env.DEPLOYMENT_NAME }} - kubectl testkube create testsuite -f ./test/suites/staging-testsuite.json --name staging-testsuite --namespace ${{ env.DEPLOYMENT_NAME }} - - - name: Run Executor tests - run: kubectl testkube run testsuite staging-testsuite -f --git-branch develop --namespace ${{ env.DEPLOYMENT_NAME }} - - - name: Run Dashboard E2E tests - run: kubectl testkube run test dashboard-e2e-tests -f --variable TESTKUBE_NAMESPACE=${{ env.DEPLOYMENT_NAME }} --namespace ${{ env.DEPLOYMENT_NAME }} - - notify_slack_if_test_suite_stage_succeeds: - runs-on: ubuntu-latest - needs: test_suite_run - steps: - - name: Slack Notification if the test suite run on ${{ env.GKE_CLUSTER_NAME }} GKE in ${{ env.DEPLOYMENT_NAME }} namespace succeeded. - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: testkube-logs - SLACK_COLOR: ${{ needs.test_suite_run.result }} # or a specific color like 'good' or '#ff00ff' - SLACK_ICON: https://github.com/rtCamp.png?size=48 - SLACK_TITLE: Test suite successfully run on ${{ env.GKE_CLUSTER_NAME }} GKE in ${{ env.DEPLOYMENT_NAME }} namespace :party_blob:! - SLACK_USERNAME: GitHub - SLACK_LINK_NAMES: true - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_FOOTER: "Kubeshop --> TestKube" - - notify_slack_if_test_suite_failed: - runs-on: ubuntu-latest - needs: test_suite_run - if: always() && (needs.test_suite_run.result == 'failure') - steps: - - name: Slack Notification if the test suite run on ${{ env.GKE_CLUSTER_NAME }} GKE in ${{ env.DEPLOYMENT_NAME }} namespace failed. - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: testkube-logs - SLACK_COLOR: ${{ needs.test_suite_run.result }} # or a specific color like 'good' or '#ff00ff' - SLACK_ICON: https://github.com/rtCamp.png?size=48 - SLACK_TITLE: Test suite FAILED to run on ${{ env.GKE_CLUSTER_NAME }} GKE in ${{ env.DEPLOYMENT_NAME }} namespace! :boom:! - SLACK_USERNAME: GitHub - SLACK_LINK_NAMES: true - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_FOOTER: "Kubeshop --> TestKube" diff --git a/.github/workflows/helm-releaser-testkube-charts.yaml b/.github/workflows/helm-releaser-testkube-charts.yaml index 3d5cbe73a..833243f39 100644 --- a/.github/workflows/helm-releaser-testkube-charts.yaml +++ b/.github/workflows/helm-releaser-testkube-charts.yaml @@ -1,6 +1,6 @@ name: Releasing Helm charts. -concurrency: demo_cluster +concurrency: develop_cluster on: push: @@ -16,9 +16,8 @@ on: env: PROJECT_ID: ${{ secrets.GKE_PROJECT }} - GKE_CLUSTER_NAME_DEV: ${{ secrets.GKE_CLUSTER_NAME_DEV }} # Add your cluster name here. - GKE_ZONE_DEV: ${{ secrets.GKE_ZONE_DEV }} # Add your cluster zone here. - DEPLOYMENT_NAME: testkube # Add your deployment name here. + GKE_CLUSTER_NAME: ${{ secrets.GKE_CLUSTER_NAME_DEVELOP }} # Add your cluster name here. + GKE_ZONE: ${{ secrets.GKE_ZONE_DEVELOP }} # Add your cluster zone here. jobs: release_charts: @@ -172,7 +171,7 @@ jobs: client-payload: '{"agentVersion": "${{ env.agent-version }}"}' - deploy-to-testkube-dev-gke: + deploy-to-testkube-integration-gke: name: Deploy runs-on: ubuntu-latest needs: notify_slack_if_release_succeeds @@ -201,8 +200,8 @@ jobs: # Get the GKE credentials so we can deploy to the cluster - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e with: - cluster_name: ${{ env.GKE_CLUSTER_NAME_DEV }} - location: ${{ env.GKE_ZONE_DEV }} + cluster_name: ${{ env.GKE_CLUSTER_NAME }} + location: ${{ env.GKE_ZONE }} credentials: ${{ secrets.GKE_SA_KEY }} - name: Install Helm @@ -218,7 +217,7 @@ jobs: # Deploy the Docker image to the GKE cluster - name: Deploy run: |- - helm upgrade --install --atomic --timeout 180s testkube helm-charts/testkube --namespace testkube --create-namespace --values ./charts/testkube/values-demo.yaml --debug --set testkube-api.cliIngress.oauth.clientID=${{ secrets.TESTKUBE_DEMO_OAUTH_CLIENT_ID }} --set testkube-api.cliIngress.oauth.clientSecret=${{ secrets.TESTKUBE_DEMO_OAUTH_CLIENT_SECRET }} --set mongodb.livenessProbe.enabled=false --set mongodb.readinessProbe.enabled=false + helm upgrade --install --atomic --timeout 180s testkube helm-charts/testkube --namespace testkube-integration --create-namespace --values ./charts/testkube/values-stage.yaml --debug --set testkube-api.cliIngress.oauth.clientID=${{ secrets.TESTKUBE_DEMO_OAUTH_CLIENT_ID }} --set testkube-api.cliIngress.oauth.clientSecret=${{ secrets.TESTKUBE_DEMO_OAUTH_CLIENT_SECRET }} --set mongodb.livenessProbe.enabled=false --set mongodb.readinessProbe.enabled=false notify_slack_if_deploy_dev_succeeds: runs-on: ubuntu-latest @@ -385,8 +384,8 @@ jobs: # Get the GKE credentials so we can deploy to the cluster - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e with: - cluster_name: ${{ env.GKE_CLUSTER_NAME_DEV }} - location: ${{ env.GKE_ZONE_DEV }} + cluster_name: ${{ env.GKE_CLUSTER_NAME }} + location: ${{ env.GKE_ZONE }} credentials: ${{ secrets.GKE_SA_KEY }} - name: Install testkube kubectl plugin diff --git a/.github/workflows/helm-releaser-testkube-main-chart-only.yaml b/.github/workflows/helm-releaser-testkube-main-chart-only.yaml index 694ce1de0..d69d520a9 100644 --- a/.github/workflows/helm-releaser-testkube-main-chart-only.yaml +++ b/.github/workflows/helm-releaser-testkube-main-chart-only.yaml @@ -1,13 +1,13 @@ name: Releasing Testkube main helm chart -concurrency: demo_cluster +concurrency: develop_cluster on: push: paths: - "charts/testkube**" - "scripts/main_chart_releaser.sh" - - "charts/testkube/values-demo.yaml" + - "charts/testkube/values-stage.yaml" - ".github/workflows/helm-releaser-testkube-main-chart-only.yaml" - "!charts/testkube/Chart.yaml" - "!charts/testkube-api/Chart.yaml" @@ -200,8 +200,8 @@ jobs: # Get the GKE credentials so we can deploy to the cluster - uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e with: - cluster_name: ${{ env.GKE_CLUSTER_NAME_DEV }} - location: ${{ env.GKE_ZONE_DEV }} + cluster_name: ${{ env.GKE_CLUSTER_NAME }} + location: ${{ env.GKE_ZONE }} credentials: ${{ secrets.GKE_SA_KEY }} - name: Install Helm @@ -217,7 +217,7 @@ jobs: # Deploy the Docker image to the GKE cluster - name: Deploy run: |- - helm upgrade --install --atomic --timeout 180s testkube helm-charts/testkube --namespace testkube --create-namespace --values ./charts/testkube/values-demo.yaml --debug --set testkube-api.cliIngress.oauth.clientID=${{ secrets.TESTKUBE_DEMO_OAUTH_CLIENT_ID }} --set testkube-api.cliIngress.oauth.clientSecret=${{ secrets.TESTKUBE_DEMO_OAUTH_CLIENT_SECRET }} --set mongodb.livenessProbe.enabled=false --set mongodb.readinessProbe.enabled=false + helm upgrade --install --atomic --timeout 180s testkube helm-charts/testkube --namespace testkube-integration --create-namespace --values ./charts/testkube/values-stage.yaml --debug --set testkube-api.cliIngress.oauth.clientID=${{ secrets.TESTKUBE_DEMO_OAUTH_CLIENT_ID }} --set testkube-api.cliIngress.oauth.clientSecret=${{ secrets.TESTKUBE_DEMO_OAUTH_CLIENT_SECRET }} --set mongodb.livenessProbe.enabled=false --set mongodb.readinessProbe.enabled=false notify_slack_if_deploy_dev_succeeds: runs-on: ubuntu-latest