diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index eb5d540..2bfd93c 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -1,4 +1,4 @@ ---- +--- image: atlassian/default-image:2 definitions: @@ -151,27 +151,7 @@ pipelines: services: - docker - step: - name: Deploy coturn/coturn-dns to staging - deployment: staging - script: - - pipe: atlassian/kubectl-run:1.1.2 - variables: - KUBE_CONFIG: $KUBE_CONFIG_STG - KUBECTL_COMMAND: '-n coturn rollout restart deployment/coturn' - - pipe: atlassian/kubectl-run:1.1.2 - variables: - KUBE_CONFIG: $KUBE_CONFIG_STG - KUBECTL_COMMAND: '-n coturn rollout status -w deployment/coturn' - - pipe: atlassian/kubectl-run:1.1.2 - variables: - KUBE_CONFIG: $KUBE_CONFIG_STG - KUBECTL_COMMAND: '-n coturn-dns rollout restart deployment/coturn-dns' - - pipe: atlassian/kubectl-run:1.1.2 - variables: - KUBE_CONFIG: $KUBE_CONFIG_STG - KUBECTL_COMMAND: '-n coturn-dns rollout status -w deployment/coturn-dns' - - step: - name: Verify and Test Staging + name: Deploy, Verify and Test Staging deployment: staging image: node:22 script: @@ -180,16 +160,20 @@ pipelines: - install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl - echo $KUBE_CONFIG_STG | base64 -d > kubeconfig - export KUBECONFIG=$(pwd)/kubeconfig - - npx playwright install-deps + - kubectl -n coturn rollout restart deployment/coturn + - kubectl -n coturn rollout status -w deployment/coturn + - kubectl -n coturn-dns rollout restart deployment/coturn-dns + - kubectl -n coturn-dns rollout status -w deployment/coturn-dns - chmod +x scripts/verify-deployment.sh - ./scripts/verify-deployment.sh $BITBUCKET_COMMIT staging + - npx playwright install-deps - git clone --depth 1 git@bitbucket.org:jamkazam/video-e2e.git - cd video-e2e - npm install - npx playwright install chromium - ./bin/staging-test after-script: - - | + - | if [ $BITBUCKET_EXIT_CODE -ne 0 ]; then curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"🚨 Pipeline Failed: Staging verification/tests failed for commit $BITBUCKET_COMMIT. \"}" https://hooks.slack.com/services/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 fi @@ -232,7 +216,7 @@ pipelines: - npx playwright install chromium - ./bin/staging-test after-script: - - | + - | if [ $BITBUCKET_EXIT_CODE -ne 0 ]; then curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"🚨 Pipeline Failed: Staging verification/tests failed for commit $BITBUCKET_COMMIT. \"}" https://hooks.slack.com/services/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 - fi + fi \ No newline at end of file