PromucFlow_constructor/scripts/deploy_preview.sh

133 lines
6.0 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
# Params are in environment variables as PARAM_{SLUG}, e.g. PARAM_USER_ID
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
set -euo pipefail
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
edition="ce"
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
# Configure AWS CLI and kubectl environment
mkdir -p ~/.aws
cat > ~/.aws/config <<EOF
[default]
region = ap-south-1
output = json
EOF
aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID"
aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY"
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
export region="ap-south-1"
export cluster_name="uatx-cluster"
echo "Region: $region"
echo "Cluster name: $cluster_name"
echo "Pull Request Number: $PULL_REQUEST_NUMBER"
2023-08-03 15:27:47 +00:00
echo "DP_EFS_ID: $DP_EFS_ID"
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
# Set naming context
export NAMESPACE="$edition$PULL_REQUEST_NUMBER"
export CHARTNAME="$edition$PULL_REQUEST_NUMBER"
export SECRET="$edition$PULL_REQUEST_NUMBER"
export DBNAME="$edition$PULL_REQUEST_NUMBER"
export DOMAINNAME="$edition-$PULL_REQUEST_NUMBER.dp.appsmith.com"
export HELMCHART="appsmith"
export HELMCHART_URL="http://helm-ee.appsmith.com"
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
# Optional environment variables (already set externally)
export OPENAI_ASSISTANT_ID="$OPENAI_ASSISTANT_ID"
export OPENAI_API_KEY="$OPENAI_API_KEY"
export APPSMITH_CARBON_API_KEY="$APPSMITH_CARBON_API_KEY"
export APPSMITH_CARBON_API_BASE_PATH="$APPSMITH_CARBON_API_BASE_PATH"
export APPSMITH_AI_SERVER_MANAGED_HOSTING="$APPSMITH_AI_SERVER_MANAGED_HOSTING"
export IN_DOCKER="$IN_DOCKER"
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
# Update kubeconfig
fix: update cluster name in deploy_preview script and adjust kubeconf… (#40981) …ig command ### 📝 Summary This commit updates the cluster name in the `deploy_preview.sh` script from `uat-cluster` to `uatx-cluster` and modifies the `aws eks update-kubeconfig` command to remove the profile option, ensuring compatibility with the current AWS configuration. ### 🎨 Changes Made - **Cluster Name Update**: Changed `export cluster_name=uat-cluster` to `export cluster_name=uatx-cluster`. - **Kubeconfig Command Adjustment**: Removed the `--profile eksci` option from the `aws eks update-kubeconfig` command for streamlined execution. No user-facing changes were made, and the script remains functional for deployment tasks. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Chores** - Updated the AWS EKS cluster name used in deployment processes. - Modified deployment script to use default AWS credentials for cluster configuration. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-06-25 11:52:25 +00:00
aws eks update-kubeconfig --region "$region" --name "$cluster_name"
kubectl config set-context --current --namespace=default
kubectl get pods
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
# Optional cleanup logic
if [[ -n "${RECREATE-}" ]]; then
echo "Wiping the DP from MongoDB and Kubernetes since the reset flag was set"
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
pod_name="$(kubectl get pods -n "$NAMESPACE" -o json | jq -r '.items[0].metadata.name')"
# execute this db.dropDatabase() from the k8s cluster because there's network restrictions on Atlas cluster.
# The \$ is used to escape the $ character in the APPSMITH_DB_URL environment variable so it's interpolated inside the kubectl exec command.
kubectl exec "$pod_name" -n "$NAMESPACE" -- bash -c "mongosh \$APPSMITH_DB_URL --eval 'db.dropDatabase()'"
kubectl exec "$pod_name" -n "$NAMESPACE" -- bash -c "rm -rf /appsmith-stacks/*"
kubectl delete ns "$NAMESPACE" || true
kubectl patch pv "$NAMESPACE-appsmith" -p '{"metadata":{"finalizers":null}}' || true
kubectl delete pv "$NAMESPACE-appsmith" --grace-period=0 --force || true
echo "DP wiped from MongoDB and Kubernetes"
fi
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
# Create namespace and image pull secret
kubectl create ns "$NAMESPACE" || true
kubectl create secret docker-registry "$SECRET" \
--docker-server=https://index.docker.io/v1/ \
--docker-username="$DOCKER_HUB_USERNAME" \
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
--docker-password="$DOCKER_HUB_ACCESS_TOKEN" \
-n "$NAMESPACE" || true
refactor: enhance deploy_preview.sh for idempotent Helm repo addition… (#41043) … and plugin management ### Changes Made - Updated Helm repo addition to be idempotent, preventing errors if the repo is already added. - Added logic to check for the existence of the mapkubeapis plugin before attempting installation, improving script robustness. - Enhanced error handling for optional commands to ensure the deployment process continues smoothly even if certain steps fail. These improvements streamline the deployment process and enhance the reliability of the script. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:52:07 +00:00
# Add Helm repo (idempotent)
AWS_REGION=us-east-2 helm repo add appsmith-ee "$HELMCHART_URL" || echo "Helm repo already added."
helm repo update
refactor: enhance deploy_preview.sh for idempotent Helm repo addition… (#41043) … and plugin management ### Changes Made - Updated Helm repo addition to be idempotent, preventing errors if the repo is already added. - Added logic to check for the existence of the mapkubeapis plugin before attempting installation, improving script robustness. - Enhanced error handling for optional commands to ensure the deployment process continues smoothly even if certain steps fail. These improvements streamline the deployment process and enhance the reliability of the script. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:52:07 +00:00
# Attempt to install the plugin only if it's not installed
if ! helm plugin list | grep -q mapkubeapis; then
echo "Installing mapkubeapis plugin..."
helm plugin install https://github.com/helm/helm-mapkubeapis || echo "Plugin installation failed, continuing..."
else
echo "mapkubeapis plugin already installed."
fi
# Run mapkubeapis (safe to fail)
echo "Running helm mapkubeapis (optional)..."
helm mapkubeapis "$CHARTNAME" -n "$NAMESPACE" || echo "mapkubeapis failed, continuing..."
# Show chart metadata
helm show chart appsmith-ee/$HELMCHART || echo "helm show chart failed (non-blocking)."
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
echo "Deploying Appsmith Helm chart..."
helm upgrade -i "$CHARTNAME" "appsmith-ee/$HELMCHART" -n "$NAMESPACE" --create-namespace --recreate-pods \
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
--set _image.repository="$DOCKER_HUB_ORGANIZATION/appsmith-dp" \
--set _image.tag="$IMAGE_HASH" \
--set _image.pullPolicy="Always" \
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
--set image.pullSecrets="$SECRET" \
--set autoscaling.enabled=true \
--set autoscaling.minReplicas=1 \
--set autoscaling.maxReplicas=1 \
--set redis.enabled=false \
--set postgresql.enabled=false \
--set mongodb.enabled=false \
--set ingress.enabled=true \
--set "ingress.annotations.service\.beta\.kubernetes\.io/aws-load-balancer-ssl-cert=$AWS_RELEASE_CERT" \
--set "ingress.hosts[0].host=$DOMAINNAME, ingress.hosts[0].paths[0].path=/, ingress.hosts[0].paths[0].pathType=Prefix" \
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
--set autoupdate.enabled=false \
--set ingress.className="nginx" \
--set persistence.efs.enabled=true \
--set persistence.efs.driver="efs.csi.aws.com" \
--set persistence.storageClass="efs-sc" \
--set persistence.efs.volumeHandle="$DP_EFS_ID:/$edition/$edition$PULL_REQUEST_NUMBER" \
--set resources.requests.cpu="1m" \
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
--set resources.requests.memory="3072Mi" \
--set podDisruptionBudgets.enabled=false \
--set applicationConfig.APPSMITH_SENTRY_DSN="https://abf15a075d1347969df44c746cca7eaa@o296332.ingest.sentry.io/1546547" \
--set applicationConfig.APPSMITH_SENTRY_ENVIRONMENT="$NAMESPACE" \
2024-07-01 16:06:43 +00:00
--set applicationConfig.APPSMITH_DB_URL="mongodb+srv://$DB_USERNAME:$DB_PASSWORD@$DB_URL/$DBNAME?retryWrites=true&minPoolSize=1&maxPoolSize=10&maxIdleTimeMS=900000&authSource=admin" \
--set applicationConfig.OPENAI_ASSISTANT_ID="$OPENAI_ASSISTANT_ID" \
--set applicationConfig.OPENAI_API_KEY="$OPENAI_API_KEY" \
--set applicationConfig.APPSMITH_CARBON_API_KEY="$APPSMITH_CARBON_API_KEY" \
--set applicationConfig.APPSMITH_CARBON_API_BASE_PATH="$APPSMITH_CARBON_API_BASE_PATH" \
--set applicationConfig.APPSMITH_AI_SERVER_MANAGED_HOSTING="$APPSMITH_AI_SERVER_MANAGED_HOSTING" \
--set applicationConfig.IN_DOCKER="$IN_DOCKER" \
2025-06-25 12:51:38 +00:00
--set applicationConfig.APPSMITH_CUSTOMER_PORTAL_URL="https://release-customer.appsmith.com" \
refactor: enhance deploy_preview.sh script for improved AWS configura… (#41042) …tion ### Changes Made - Updated the script to set strict error handling with `set -euo pipefail`. - Streamlined AWS CLI configuration by creating the `~/.aws/config` file directly. - Removed deprecated `dp-node-affinity-values.yaml` file and integrated node affinity and tolerations directly into the Helm chart deployment command. - Improved pod name retrieval and added optional cleanup logic for better resource management during deployment. These changes enhance the reliability and maintainability of the deployment process. ## 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 <!-- This is an auto-generated comment: Cypress test results --> > [!CAUTION] > If you modify the content in this section, you are likely to disrupt the CI result for your PR. <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No
2025-06-25 13:38:25 +00:00
--set affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].key=instance_name \
--set affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].operator=In \
--set affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0].values[0]=uatx-shared \
--set tolerations[0].key=instance_name \
--set tolerations[0].operator=Equal \
--set tolerations[0].value=uatx-shared \
--set tolerations[0].effect=NoSchedule