chore: update cleanup dp to delete merged PRs (#41045)

## Description
> [!TIP]  
> _Add a TL;DR when the description is longer than 500 words or
extremely technical (helps the content, marketing, and DevRel team)._
>
> _Please also include relevant motivation and context. List any
dependencies that are required for this change. Add links to Notion,
Figma or any other documents that might be relevant to the PR._


Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags=""

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!WARNING]
> Tests have not run on the HEAD
9501b3de7fb5d2ef60a9c0411f4523661faee467 yet
> <hr>Thu, 26 Jun 2025 05:31:26 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
This commit is contained in:
Goutham Pratapa 2025-06-26 11:04:15 +05:30 committed by GitHub
parent 5232b3f89e
commit 7bcd86d87f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,27 +1,21 @@
#!/bin/bash #!/bin/bash
# Configure the AWS & kubectl environment # Configure the AWS & kubectl environment
mkdir ~/.aws; touch ~/.aws/config mkdir -p ~/.aws
cat > ~/.aws/config <<EOF
echo "[default] [default]
aws_access_key_id = $AWS_ACCESS_KEY_ID region = ap-south-1
aws_secret_access_key = $AWS_SECRET_ACCESS_KEY" > ~/.aws/credentials
echo "[default]
region = $region
output = json output = json
[profile eksci] EOF
role_arn= $AWS_ROLE_ARN
output = json
region = $region
source_profile = default" > ~/.aws/config
sts_output=$(aws sts assume-role --role-arn env.AWS_ROLE_ARN --role-session-name ekscisession) aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID"
export AWS_ACCESS_KEY_ID=$(echo $sts_output | jq -r '.Credentials''.AccessKeyId');\ aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY"
export AWS_SECRET_ACCESS_KEY=$(echo $sts_output | jq -r '.Credentials''.SecretAccessKey');\
export AWS_SESSION_TOKEN=$(echo $sts_output | jq -r '.Credentials''.SessionToken');
aws eks update-kubeconfig --region ap-south-1 --name uat-cluster --profile eksci export region="ap-south-1"
export cluster_name="uatx-cluster"
# Update kubeconfig
aws eks update-kubeconfig --region "$region" --name "$cluster_name"
echo "Set the default namespace" echo "Set the default namespace"
kubectl config set-context --current --namespace=default kubectl config set-context --current --namespace=default
@ -46,7 +40,5 @@ for i in $deployed_charts
kubectl delete ns $i || true kubectl delete ns $i || true
kubectl patch pv $i-appsmith -p '{"metadata":{"finalizers":null}}' || true kubectl patch pv $i-appsmith -p '{"metadata":{"finalizers":null}}' || true
kubectl delete pv $i-appsmith --grace-period=0 --force || true kubectl delete pv $i-appsmith --grace-period=0 --force || true
# ACCESS_POINT_ID=$(aws efs describe-access-points --file-system-id "$DP_EFS_ID" | jq -r '.AccessPoints[] | select(.Name=="'"ce$pr"'") | .AccessPointId')
# aws efs delete-access-point --access-point-id $ACCESS_POINT_ID
fi fi
done done