Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
[44;97;1m π€ Plandex [0;0;22m π Modify deploy.sh to check for ECR repository existence βοΈ Edits: β’ infra/deploy.sh β Ensure ECR repository exists before deployment
Dane Schneiderb76cba858247
diff --git a/infra/deploy.sh b/infra/deploy.shindex 4b0d9558..7b65d495 100644--- a/infra/deploy.sh+++ b/infra/deploy.sh@@ -28,6 +28,7 @@ handle_error() {trap 'handle_error' ERR+export AWS_PROFILE=plandex# Generate a unique tag for the deploymentexport STACK_TAG=$(uuidgen | cut -d '-' -f1)@@ -36,6 +37,22 @@ export STACK_TAG=$(uuidgen | cut -d '-' -f1)ECR_REPOSITORY=$(aws ecr describe-repositories --repository-names plandex-ecr-repository | jq -r '.repositories[0].repositoryUri')IMAGE_TAG=$(git rev-parse --short HEAD)+# Function to ensure the ECR repository exists+ensure_ecr_repository_exists() {+ # Check if the ECR repository exists+ ECR_REPO_EXISTS=$(aws ecr describe-repositories --repository-names plandex-ecr-repository 2>/dev/null)+ if [ -z "$ECR_REPO_EXISTS" ]; then+ # Create the ECR repository if it does not exist+ aws ecr create-repository --repository-name plandex-ecr-repository+ log "ECR repository 'plandex-ecr-repository' created."+ else+ log "ECR repository 'plandex-ecr-repository' already exists."+ fi+}++# Ensure the ECR repository exists before proceeding+ensure_ecr_repository_exists+# Function to deploy or update the CloudFormation stack using AWS CDKdeploy_or_update_stack() {# Check if the stack exists