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 π Resolve issues with storing STACK_TAG and image upload in deploy script βοΈ Edits: β’ infra/deploy.sh β Store and retrieve STACK_TAG to allow stack updates β Ensure image is uploaded to ECR before stack deployment β Ensure image is pushed to ECR before stack deployment
Dane Schneiderc7e52fc23d52
diff --git a/infra/deploy.sh b/infra/deploy.shindex 0e8ae7e6..7fadaa5a 100755--- a/infra/deploy.sh+++ b/infra/deploy.sh@@ -33,7 +33,31 @@ log "Deploying the infrastructure..."export AWS_PROFILE=plandex# Generate a unique tag for the deployment-export STACK_TAG=$(uuidgen | cut -d '-' -f1)+# Path to the file where the STACK_TAG is stored+STACK_TAG_FILE="stack-tag.txt"++# Function to generate a new STACK_TAG and save it to the file+generate_and_save_stack_tag() {+ export STACK_TAG=$(uuidgen | cut -d '-' -f1)+ echo $STACK_TAG > $STACK_TAG_FILE+ log "Generated new STACK_TAG: $STACK_TAG"+}++# Function to load the existing STACK_TAG from the file+load_stack_tag() {+ export STACK_TAG=$(cat $STACK_TAG_FILE)+ log "Loaded existing STACK_TAG: $STACK_TAG"+}++# Check if the STACK_TAG file exists and load it, otherwise generate a new one+if [ -f "$STACK_TAG_FILE" ]; then+ log "Loading existing STACK_TAG from file..."+ load_stack_tag+else+ log "Generating new STACK_TAG and saving to file..."+ generate_and_save_stack_tag+fi+# Function to ensure the ECR repository exists@@ -108,14 +132,16 @@ update_ecs_service() {aws ecs update-service --cluster "$CLUSTER_NAME" --service "$SERVICE_NAME" --task-definition $TASK_DEF_ARN}-# Deploy or update the CloudFormation stack-log "Deploying or updating the CloudFormation stack..."-deploy_or_update_stack+log "Building and pushing the Docker image to ECR..."+build_and_push_image-# Build and push the Docker image to ECRlog "Building and pushing the Docker image to ECR..."build_and_push_image+# Deploy or update the CloudFormation stack+log "Deploying or updating the CloudFormation stack..."+deploy_or_update_stack+# Update the ECS service with the new Docker imagelog "Updating the ECS service with the new Docker image..."update_ecs_service