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
deploy script fix, db connection escape password
Dane Schneider3898b1e5baef
diff --git a/app/server/db/db.go b/app/server/db/db.goindex 20dfc8d4..870a6bb6 100644--- a/app/server/db/db.go+++ b/app/server/db/db.go@@ -4,6 +4,7 @@ import ("errors""fmt""log"+ "net/url""os""github.com/golang-migrate/migrate/v4"@@ -25,7 +26,9 @@ func Connect() error {os.Getenv("DB_USER") != "" &&os.Getenv("DB_PASSWORD") != "" &&os.Getenv("DB_NAME") != "" {- dbUrl = "postgres://" + os.Getenv("DB_USER") + ":" + os.Getenv("DB_PASSWORD") + "@" + os.Getenv("DB_HOST") + ":" + os.Getenv("DB_PORT") + "/" + os.Getenv("DB_NAME")+ encodedPassword := url.QueryEscape(os.Getenv("DB_PASSWORD"))++ dbUrl = "postgres://" + os.Getenv("DB_USER") + ":" + encodedPassword + "@" + os.Getenv("DB_HOST") + ":" + os.Getenv("DB_PORT") + "/" + os.Getenv("DB_NAME")}if dbUrl == "" {diff --git a/infra/deploy.sh b/infra/deploy.shindex f3a6fd00..f2e3cb0e 100755--- a/infra/deploy.sh+++ b/infra/deploy.sh@@ -98,6 +98,8 @@ export IMAGE_TAG=$(git rev-parse --short HEAD)log "IMAGE_TAG: $IMAGE_TAG"+IS_NEW_STACK=false+# Function to deploy or update the CloudFormation stack using AWS CDKdeploy_or_update_stack() {# Check if the stack exists@@ -106,6 +108,7 @@ deploy_or_update_stack() {if [ -z "$STACK_NAME" ]; then# Deploy the stack if it does not existnpx cdk deploy --require-approval never --app "npx ts-node src/main.ts" --context stackTag=$STACK_TAG "plandex-stack-$STACK_TAG"+ IS_NEW_STACK=trueelse# Update the stack if it existsnpx cdk deploy "$STACK_NAME" --require-approval never --app "npx ts-node src/main.ts"@@ -189,8 +192,12 @@ elselog "Skipping deploy_or_update_stack due to --image-only flag"fi-# Update the ECS service with the new Docker image-log "Updating the ECS service with the new Docker image..."-update_ecs_service+# Update the ECS service with the new Docker image if it's not a new stack+if [ "$IS_NEW_STACK" = false ]; then+ log "Updating the ECS service with the new Docker image..."+ update_ecs_service+else+ log "Skipping update_ecs_service for new stack"+filog "Infrastructure deployed successfully"\ No newline at end of file