Skip to content

Commit

Permalink
fix: added install gcloud beta component in pipeline.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
payaljindal committed Mar 22, 2024
1 parent 4e1b9cc commit a0ec366
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tools/target-server-validator/pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ SCRIPTPATH="$(
pwd -P
)"

gcloud components install beta --quiet # as the cloud-sdk image no longer has this
NOTIFICATION_CHANNEL_IDS=$(bash "$SCRIPTPATH/test/create_notification_channel.sh" "$APIGEE_X_ORG" 2>&1)
if [ -z "$NOTIFICATION_CHANNEL_IDS" ]; then
echo "Error creating notification channel"
exit 1
else
echo "Notification Channel Id - ${NOTIFICATION_CHANNEL_IDS}"
echo "Created Notification Channel Id - ${NOTIFICATION_CHANNEL_IDS}"
fi

bash "$SCRIPTPATH/callout/build_java_callout.sh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type=$(jq -r '.type' $JSON_FILE)
displayName=$(jq -r '.displayName' $JSON_FILE)
emailAddress=$(jq -r '.labels.email_address' $JSON_FILE)

list_response=$(gcloud alpha monitoring channels list --filter="type='$type' AND displayName=\"$displayName\" AND labels.email_address='$emailAddress'" --format=json --verbosity=none --project="$PROJECT_ID" --format=json 2>&1)
list_response=$(gcloud beta monitoring channels list --filter="type='$type' AND displayName=\"$displayName\" AND labels.email_address='$emailAddress'" --format=json --verbosity=none --project="$PROJECT_ID" 2>&1)

if [ "$list_response" = "[]" ]; then

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ IFS=','

# Loop through each notification channel ID and delete it
for CHANNEL_ID in $NOTIFICATION_CHANNEL_IDS; do
gcloud beta monitoring channels delete "$CHANNEL_ID" --project="$PROJECT_ID" --quiet
yes | gcloud beta monitoring channels delete "$CHANNEL_ID" --project="$PROJECT_ID" \
|| echo "Couldn't delete Notification Channel"
done

0 comments on commit a0ec366

Please sign in to comment.