Skip to content

Commit 7bcd86d

Browse files
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 9501b3d 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
1 parent 5232b3f commit 7bcd86d

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

scripts/cleanup_dp.sh

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
#!/bin/bash
22
# Configure the AWS & kubectl environment
33

4-
mkdir ~/.aws; touch ~/.aws/config
5-
6-
echo "[default]
7-
aws_access_key_id = $AWS_ACCESS_KEY_ID
8-
aws_secret_access_key = $AWS_SECRET_ACCESS_KEY" > ~/.aws/credentials
9-
10-
echo "[default]
11-
region = $region
4+
mkdir -p ~/.aws
5+
cat > ~/.aws/config <<EOF
6+
[default]
7+
region = ap-south-1
128
output = json
13-
[profile eksci]
14-
role_arn= $AWS_ROLE_ARN
15-
output = json
16-
region = $region
17-
source_profile = default" > ~/.aws/config
9+
EOF
10+
11+
aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID"
12+
aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY"
1813

19-
sts_output=$(aws sts assume-role --role-arn env.AWS_ROLE_ARN --role-session-name ekscisession)
20-
export AWS_ACCESS_KEY_ID=$(echo $sts_output | jq -r '.Credentials''.AccessKeyId');\
21-
export AWS_SECRET_ACCESS_KEY=$(echo $sts_output | jq -r '.Credentials''.SecretAccessKey');\
22-
export AWS_SESSION_TOKEN=$(echo $sts_output | jq -r '.Credentials''.SessionToken');
14+
export region="ap-south-1"
15+
export cluster_name="uatx-cluster"
2316

24-
aws eks update-kubeconfig --region ap-south-1 --name uat-cluster --profile eksci
17+
# Update kubeconfig
18+
aws eks update-kubeconfig --region "$region" --name "$cluster_name"
2519

2620
echo "Set the default namespace"
2721
kubectl config set-context --current --namespace=default
@@ -46,7 +40,5 @@ for i in $deployed_charts
4640
kubectl delete ns $i || true
4741
kubectl patch pv $i-appsmith -p '{"metadata":{"finalizers":null}}' || true
4842
kubectl delete pv $i-appsmith --grace-period=0 --force || true
49-
# ACCESS_POINT_ID=$(aws efs describe-access-points --file-system-id "$DP_EFS_ID" | jq -r '.AccessPoints[] | select(.Name=="'"ce$pr"'") | .AccessPointId')
50-
# aws efs delete-access-point --access-point-id $ACCESS_POINT_ID
5143
fi
5244
done

0 commit comments

Comments
 (0)