Skip to content

Commit

Permalink
feat: Added gcloud in sanity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
13archit committed Sep 4, 2024
1 parent d68e800 commit 485629c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/sanity-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ jobs:
mismatches="$mismatches\nHelm version mismatch: expected $LATEST_HELM_VERSION, got $INSTALLED_HELM_VERSION"
fi
# Google Cloud SDK (gcloud)
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-linux-x86_64.tar.gz
tar -xf google-cloud-cli-linux-x86_64.tar.gz
./google-cloud-sdk/install.sh --quiet
export PATH=$PATH:$PWD/google-cloud-sdk/bin
LATEST_GCLOUD_VERSION=$(gcloud --version | grep -oP '(?<=Google Cloud SDK )\S+')
INSTALLED_GCLOUD_VERSION=$(docker exec devops gcloud --version | grep -oP '(?<=Google Cloud SDK )\S+')
echo "Google Cloud SDK versions - Latest: $LATEST_GCLOUD_VERSION, Installed: $INSTALLED_GCLOUD_VERSION"
if [ "$LATEST_GCLOUD_VERSION" != "$INSTALLED_GCLOUD_VERSION" ]; then
mismatches="$mismatches\nGoogle Cloud SDK version mismatch: expected $LATEST_GCLOUD_VERSION, got $INSTALLED_GCLOUD_VERSION"
fi
# Print mismatches and fail if any
if [ -n "$mismatches" ]; then
echo -e "Version mismatches found:$mismatches"
Expand Down

0 comments on commit 485629c

Please sign in to comment.