-
-
Notifications
You must be signed in to change notification settings - Fork 696
LocalStack Build And Push Docker Images and Other Improvements #5463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/infrastructure-localstack
Are you sure you want to change the base?
Changes from all commits
db0ae4c
fc5fcd8
56dda38
34fde20
d63cfc8
c9471cb
d415a5e
fb91738
7dc3088
16d4f34
72a8738
67172b8
86bf40b
99bca3f
506ffeb
2e0b6de
43f257a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| FROM localstack/localstack:2026.7.1@sha256:bdc261f58767dda5385800cfcefae7e8036f91428f26117b29c4572a7a9bbdc9 | ||
| FROM localstack/localstack:2026.7.4@sha256:f7b778d03717b58c3adce81a740bfafff5c6f9d639159bbf08da557c9ac1b513 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| NEXT_PUBLIC_API_URL=/ | ||
| NEXT_PUBLIC_CSRF_URL=/csrf/ | ||
| NEXT_PUBLIC_ENVIRONMENT=production | ||
| NEXT_PUBLIC_GRAPHQL_URL=/graphql/ | ||
| NEXT_PUBLIC_GTM_ID= | ||
| NEXT_PUBLIC_IDX_URL=/idx/ | ||
| NEXT_PUBLIC_IS_PROJECT_HEALTH_ENABLED=true | ||
| NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com | ||
| NEXT_PUBLIC_POSTHOG_KEY= | ||
| NEXT_PUBLIC_RELEASE_VERSION= | ||
| NEXT_PUBLIC_SENTRY_DSN= |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| bucket = "nest-localstack-terraform-state" | ||
| endpoints = { s3 = "http://localstack:4566" } | ||
| key = "localstack/terraform.tfstate" | ||
| region = "us-east-1" | ||
| use_path_style = true |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,20 +1,28 @@ | ||||||
| .PHONY: infrastructure-up | ||||||
| .PHONY: infrastructure-check-auth-token infrastructure-refresh infrastructure-up | ||||||
|
|
||||||
| DOCKER_GID := $(shell stat -c '%g' /var/run/docker.sock 2>/dev/null || stat -f '%g' /var/run/docker.sock) | ||||||
| export DOCKER_GID | ||||||
|
|
||||||
| INFRASTRUCTURE_COMPOSE = docker compose \ | ||||||
| --project-name nest-infrastructure \ | ||||||
| -f docker-compose/infrastructure/compose.yaml | ||||||
|
|
||||||
| infrastructure-up: ## Start LocalStack and deploy infrastructure | ||||||
| infrastructure-check-auth-token: | ||||||
| @if [ -z "$$LOCALSTACK_AUTH_TOKEN" ]; then \ | ||||||
| if [ -t 2 ]; then \ | ||||||
| printf '\033[1;31mError:\033[0m LOCALSTACK_AUTH_TOKEN is not set.\n' >&2; \ | ||||||
| else \ | ||||||
| echo "Error: LOCALSTACK_AUTH_TOKEN is not set." >&2; \ | ||||||
| fi; \ | ||||||
| exit 1; \ | ||||||
| fi; \ | ||||||
| $(MAKE) infrastructure-image-build || exit $$?; \ | ||||||
| COMPOSE_BAKE=true DOCKER_BUILDKIT=1 \ | ||||||
| $(INFRASTRUCTURE_COMPOSE) \ | ||||||
| -f docker-compose/infrastructure/compose.deploy.yaml \ | ||||||
| up | ||||||
| fi | ||||||
|
|
||||||
| infrastructure-refresh: infrastructure-check-auth-token ## Refresh an existing deployment on LocalStack | ||||||
| @$(MAKE) infrastructure-image-build || exit $$?; \ | ||||||
| $(INFRASTRUCTURE_COMPOSE) up --wait localstack || exit $$?; \ | ||||||
| $(INFRASTRUCTURE_COMPOSE) run --rm runner python -m scripts.run_deploy --refresh | ||||||
|
|
||||||
| infrastructure-up: infrastructure-check-auth-token ## Start LocalStack and deploy infrastructure | ||||||
| @$(MAKE) infrastructure-image-build || exit $$?; \ | ||||||
| $(INFRASTRUCTURE_COMPOSE) up --wait localstack || exit $$?; \ | ||||||
| $(INFRASTRUCTURE_COMPOSE) run --rm runner python -m scripts.run_deploy | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: When the deployment runner exits non-zero, (Based on your team's feedback about preserving the LocalStack deployment lifecycle.) [0389fa83-4d4f-455a-a265-8d983703c932] Prompt for AI agents
Suggested change
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,12 +44,6 @@ infrastructure-test-integration: | |
| $(MAKE) infrastructure-image-build || exit $$?; \ | ||
| status=0; \ | ||
| trap '$(INFRASTRUCTURE_COMPOSE) down --remove-orphans >/dev/null 2>&1 || true' EXIT; \ | ||
| COMPOSE_BAKE=true DOCKER_BUILDKIT=1 \ | ||
| $(INFRASTRUCTURE_COMPOSE) \ | ||
| -f docker-compose/infrastructure/compose.integration.yaml \ | ||
| up \ | ||
| --abort-on-container-exit \ | ||
| --build \ | ||
| --exit-code-from runner \ | ||
| || status=$$?; \ | ||
| $(INFRASTRUCTURE_COMPOSE) up --wait localstack || exit $$?; \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: When a developer already has the Compose LocalStack image, this target can run integration tests against a stale pinned version because Prompt for AI agents |
||
| $(INFRASTRUCTURE_COMPOSE) run --rm runner python -m scripts.run_tests --integration || status=$$?; \ | ||
| exit $$status | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: When this Compose file is run without the Make target, an unset
DOCKER_GIDbecomes an empty group ID and the runner fails before deployment. Default the value to0or fail with an explicit required-variable check.Prompt for AI agents