Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chg(local): setup localstack on just run_local, make localstack setup idempotent (#3695)

teo1462e9d54a42
diff --git a/justfile b/justfile
index 1d43dde461..4bb81dca3f 100644
--- a/justfile
+++ b/justfile
@@ -66,6 +66,10 @@ run_local *ARGS:
set -euo pipefail
just create_networks
+ AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-test}" \
+ AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY:-test}" \
+ AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}" \
+ just setup_localstack
just patch_local_fusionauth_env
do_build=false
diff --git a/local_stack.just b/local_stack.just
index c828d03ca8..f590445e6b 100644
--- a/local_stack.just
+++ b/local_stack.just
@@ -4,16 +4,25 @@ export AWS_PAGER := ""
# Start LocalStack for local AWS emulation
# Pinned to v4 — `latest` requires LOCALSTACK_AUTH_TOKEN for all features.
start_localstack:
- docker rm -f localstack 2>/dev/null || true
- docker run -d --name localstack \
- --network databases \
- -p 4566:4566 \
- -e SERVICES=sqs,dynamodb,s3 \
- localstack/localstack:4
- @echo "LocalStack started"
- @echo "Waiting for LocalStack to be ready..."
- @until curl -fsS http://localhost:4566/_localstack/health >/dev/null 2>&1; do sleep 1; done
- @echo "LocalStack ready"
+ #!/usr/bin/env bash
+ set -euo pipefail
+ if docker ps --format '{{ "{{.Names}}" }}' | grep -qx localstack; then
+ echo "LocalStack already running"
+ elif docker ps -a --format '{{ "{{.Names}}" }}' | grep -qx localstack; then
+ docker start localstack >/dev/null
+ echo "LocalStack started"
+ else
+ docker run -d --name localstack \
+ --network databases \
+ -p 4566:4566 \
+ -e SERVICES=sqs,dynamodb,s3 \
+ localstack/localstack:4
+ echo "LocalStack started"
+ fi
+ docker network connect databases localstack 2>/dev/null || true
+ echo "Waiting for LocalStack to be ready..."
+ until curl -fsS http://localhost:4566/_localstack/health >/dev/null 2>&1; do sleep 1; done
+ echo "LocalStack ready"
# Create SQS queues in LocalStack
create_local_queues: