Skip to content

Commit

Permalink
NIT-1279 swithing off debug mode and change in exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
pbasumatary committed Jun 11, 2024
1 parent 37d0318 commit 3ebce76
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/restore-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: |
#!/bin/bash
set -xe
set -e
SERVICE_POD_DEPLOYMENT=$(kubectl get deployment -l app=service-pod -o jsonpath="{.items[0].metadata.name}")
SERVICE_POD_NAME=$(kubectl get pod -l app=$SERVICE_POD_DEPLOYMENT -o jsonpath="{.items[0].metadata.name}")
Expand All @@ -58,15 +58,15 @@ jobs:
# check if object is present or not
object_versions=$(aws s3api list-object-versions --bucket "$S3_BUCKET_NAME" --prefix "${S3_OBJECT_KEY}")
if [[ -z "$object_versions" ]]; then
echo "Object not found in bucket"
echo "Object not found in the bucket."
exit 1
fi
# Delete the delete marker versions
version_id=$(aws s3api list-object-versions --bucket "$S3_BUCKET_NAME" --prefix "${S3_OBJECT_KEY}" --query "DeleteMarkers[0].[VersionId]" --output text)
if [[ "$version_id" = "None" ]]; then
echo "No version id found"
exit 1
echo "There is no Delete Marker present for the object, so no version id found, exiting normally."
exit 0
fi
aws s3api delete-object --bucket "$S3_BUCKET_NAME" --key "${S3_OBJECT_KEY}" --version-id "$version_id"
Expand Down

0 comments on commit 3ebce76

Please sign in to comment.