From 7bcd86d87f161926ac10547fbaec993d8ae9355a Mon Sep 17 00:00:00 2001 From: Goutham Pratapa Date: Thu, 26 Jun 2025 11:04:15 +0530 Subject: [PATCH] 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="" ### :mag: Cypress test results > [!WARNING] > Tests have not run on the HEAD 9501b3de7fb5d2ef60a9c0411f4523661faee467 yet >
Thu, 26 Jun 2025 05:31:26 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No --- scripts/cleanup_dp.sh | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/scripts/cleanup_dp.sh b/scripts/cleanup_dp.sh index 2a0977718f..b3a6a64ffd 100755 --- a/scripts/cleanup_dp.sh +++ b/scripts/cleanup_dp.sh @@ -1,27 +1,21 @@ #!/bin/bash # Configure the AWS & kubectl environment -mkdir ~/.aws; touch ~/.aws/config - -echo "[default] -aws_access_key_id = $AWS_ACCESS_KEY_ID -aws_secret_access_key = $AWS_SECRET_ACCESS_KEY" > ~/.aws/credentials - -echo "[default] -region = $region +mkdir -p ~/.aws +cat > ~/.aws/config < ~/.aws/config +EOF -sts_output=$(aws sts assume-role --role-arn env.AWS_ROLE_ARN --role-session-name ekscisession) -export AWS_ACCESS_KEY_ID=$(echo $sts_output | jq -r '.Credentials''.AccessKeyId');\ -export AWS_SECRET_ACCESS_KEY=$(echo $sts_output | jq -r '.Credentials''.SecretAccessKey');\ -export AWS_SESSION_TOKEN=$(echo $sts_output | jq -r '.Credentials''.SessionToken'); +aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID" +aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" -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" kubectl config set-context --current --namespace=default @@ -46,7 +40,5 @@ for i in $deployed_charts kubectl delete ns $i || true kubectl patch pv $i-appsmith -p '{"metadata":{"finalizers":null}}' || 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 done