mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 19:23:52 +00:00
QA deploy to CI push (#1119)
* updating the way we are deploying the web qa project * adding double quotes to try to fix the new image tag * trying the env var on a multi-line * fixed the git ref image name in the build workflow * fixing the the image tag in the qa deploy workflow * adding in the k8s namespace to the set image
This commit is contained in:
28
.github/workflows/qa-deploy.yml
vendored
28
.github/workflows/qa-deploy.yml
vendored
@@ -2,7 +2,10 @@ name: QA Deploy
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs: {}
|
||||
inputs:
|
||||
image_extension:
|
||||
description: "Image tag extension"
|
||||
required: false
|
||||
|
||||
env:
|
||||
QA_CLUSTER_RESOURCE_GROUP: "bitwarden-devops"
|
||||
@@ -12,7 +15,7 @@ env:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy QA Web Vault
|
||||
name: Deploy QA Web
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
@@ -28,7 +31,6 @@ jobs:
|
||||
creds: ${{ secrets.AZURE_QA_KV_CREDENTIALS }}
|
||||
|
||||
- name: Retrieve secrets
|
||||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
|
||||
id: retrieve-secrets
|
||||
uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403
|
||||
with:
|
||||
@@ -49,8 +51,20 @@ jobs:
|
||||
echo "---az get-creds---"
|
||||
az aks get-credentials -n $QA_CLUSTER_NAME -g $QA_CLUSTER_RESOURCE_GROUP
|
||||
|
||||
- name: Redeploy Web image
|
||||
- name: Get image tag
|
||||
id: image_tag
|
||||
run: |
|
||||
POD_NAME=$(kubectl get po -n $QA_K8S_NAMESPACE -l app=$QA_K8S_APP_NAME -o jsonpath="{.items[0].metadata.name}")
|
||||
echo "Deleting pod: $POD_NAME"
|
||||
kubectl delete po -n bw-qa $POD_NAME
|
||||
IMAGE_TAG=$(echo "$GITHUB_REF" | awk '{split($0, a, "/"); print a[3];}')
|
||||
TAG_EXTENSION=${{ github.events.inputs.image_extension }}
|
||||
|
||||
if [[ $TAG_EXTENSION ]]; then
|
||||
IMAGE_TAG=$IMAGE_TAG-$TAG_EXTENSION
|
||||
fi
|
||||
echo "::set-output name=value::$IMAGE_TAG"
|
||||
|
||||
- name: Deploy Web image
|
||||
env:
|
||||
IMAGE_TAG: ${{ steps.image_tag.outputs.value }}
|
||||
run: |
|
||||
kubectl set image -n $QA_K8S_NAMESPACE deployment/web web=bitwardenqa.azurecr.io/web:$IMAGE_TAG --record
|
||||
kubectl rollout status deployment/web -n $QA_K8S_NAMESPACE
|
||||
|
||||
Reference in New Issue
Block a user