Skip to content

feat: local and VPS Compose project is {shop-id}-{env} - #37

Merged
ROBJkE merged 9 commits into
mainfrom
cursor/env-init-compose-project-name-30a9
Sep 17, 2026
Merged

ROBJkE merged 9 commits into
mainfrom
cursor/env-init-compose-project-name-30a9

Conversation

@ROBJkE

@ROBJkE ROBJkE commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Shared shop-root .env is git-committed and must not hold env-specific values. Local/dev uses the same Compose project name as VPS: {shop-id}-{env} (not the folder basename).

shopware env init

  • May set SHOPWARE_SHOP_ID (same slug everywhere) and optional IMAGE in committed .env.
  • Comments out uncommented COMPOSE_PROJECT_NAME (create’s sw-…) and leftover SHOPWARE_DEPLOY_ENV in shared .env. Never writes COMPOSE_PROJECT_NAME or SHOPWARE_DEPLOY_ENV into shared .env.
  • Writes SHOPWARE_DEPLOY_ENV from --env and COMPOSE_PROJECT_NAME={shop-id}-{env} (e.g. acme-dev, acme-live) to .env.local (gitignored; created if missing). Default live when unset and no host value; leftover shared .env deploy env is migrated then commented.
  • Upserts top-level Compose name: {shop-id}-{env} in gitignored compose.override.yaml (create if missing; if the file exists, set/replace only that key). Compose and shopware-cli project dev auto-read COMPOSE_PROJECT_NAME only from project-directory .env, not .env.local, so the YAML name: is what names the local stack. shopware-cli regenerates compose.yaml and leaves compose.override.yaml for local customization.
  • Merge from .env.example skips COMPOSE_PROJECT_NAME / SHOPWARE_DEPLOY_ENV.

Loader

  • Later files still win (.env → .env.local → .env.prod). Empty SHOPWARE_DEPLOY_ENV= / COMPOSE_PROJECT_NAME= is ignored so a host file can own the value over an empty leftover in .env. Process-env still wins when non-empty.

Compose naming (VPS, db import, rewrite)

  • Source of truth is only compose name: interpolating host env files: VPS deploy/compose.yaml name: "${SHOPWARE_SHOP_ID:?…}-${SHOPWARE_DEPLOY_ENV:?…}", local gitignored compose.override.yaml name:.
  • Compose argv always passes --env-file .env, then --env-file .env.local / --env-file .env.prod when those files exist under the shop root (same order as identity load).
  • No -p / --project-name on VPS release/rollback, db import, rewrite, restore, or sync compose paths. vps_compose_argv and compose_argv take the shop root (no project-name parameter). Leftover COMPOSE_PROJECT_NAME in committed .env is commented out by env init.

Unchanged: no MYSQL/APP_URL invention, no APP_SECRET generation, no --vps / --generate-app-secret, no release-tag bump. recipes/shopware-cd not touched.

cargo test --locked passed (201 unit tests plus integration).

Open in Web Open in Cursor 

env init now writes COMPOSE_PROJECT_NAME=shopware-<shop-id> (no deploy-env
suffix) so local shopware-cli project dev and Compose share a stable name,
instead of commenting out create's COMPOSE_PROJECT_NAME=sw-… line.

Co-authored-by: ROBJkE <ROBJkE@users.noreply.github.com>
@ROBJkE
ROBJkE marked this pull request as ready for review September 17, 2026 06:59
env init still writes COMPOSE_PROJECT_NAME=shopware-<shop-id> for local
shopware-cli project dev. VPS compose argv now passes -p <shop-id>-<env>
so that local name cannot collide live/staging on one Docker host.

Co-authored-by: ROBJkE <ROBJkE@users.noreply.github.com>
@cursor cursor Bot changed the title feat: set COMPOSE_PROJECT_NAME=shopware-<shop-id> in env init feat: set COMPOSE_PROJECT_NAME=shopware-<shop-id> in env init; pin VPS -p Sep 17, 2026
@cursor cursor Bot changed the title feat: set COMPOSE_PROJECT_NAME=shopware-<shop-id> in env init; pin VPS -p HOLD: env init COMPOSE_PROJECT_NAME (paused — file layout TBD) Sep 17, 2026
Shared .env is git-committed and must not hold env-specific values. env init
comments out uncommented COMPOSE_PROJECT_NAME and leftover SHOPWARE_DEPLOY_ENV
in .env, and writes SHOPWARE_DEPLOY_ENV to gitignored .env.local. Loader skips
empty SHOPWARE_DEPLOY_ENV so host files win. VPS compose still pins
-p <shop-id>-<env> from identity.

Co-authored-by: ROBJkE <ROBJkE@users.noreply.github.com>
@cursor cursor Bot changed the title HOLD: env init COMPOSE_PROJECT_NAME (paused — file layout TBD) feat: env init comments COMPOSE_PROJECT_NAME; deploy env in .env.local Sep 17, 2026
env init writes COMPOSE_PROJECT_NAME=<shop-id>-<env> to gitignored
.env.local and upserts top-level Compose name: in gitignored
compose.override.yaml so shopware-cli project dev matches VPS.
Shared .env still does not get COMPOSE_PROJECT_NAME or SHOPWARE_DEPLOY_ENV.

Co-authored-by: ROBJkE <ROBJkE@users.noreply.github.com>
@cursor cursor Bot changed the title feat: env init comments COMPOSE_PROJECT_NAME; deploy env in .env.local feat: local and VPS Compose project is &lt;shop-id&gt;-&lt;env&gt; Sep 17, 2026
@cursor cursor Bot changed the title feat: local and VPS Compose project is &lt;shop-id&gt;-&lt;env&gt; feat: local and VPS Compose project is {shop-id}-{env} Sep 17, 2026
cursoragent and others added 5 commits September 17, 2026 09:16
VPS docker compose loads .env, then .env.local/.env.prod when present,
so deploy/compose.yaml name: interpolates SHOPWARE_DEPLOY_ENV. Keep -p
<shop-id>-<env> as a matching pin.

Co-authored-by: ROBJkE <ROBJkE@users.noreply.github.com>
VPS project name comes only from deploy/compose.yaml name: interpolating
host env files (.env, then .env.local/.env.prod when present).

Co-authored-by: ROBJkE <ROBJkE@users.noreply.github.com>
VpsContext no longer stores a project name used only for docker compose -p.
Bootstrap still derives {shop-id}-{env} for operator notes.

Co-authored-by: ROBJkE <ROBJkE@users.noreply.github.com>
Import, rewrite, restore, and sync compose argv use the same naming SoT
as VPS: compose name: interpolating host env files in identity-load
order. compose_argv no longer takes a project name or emits -p.

Co-authored-by: ROBJkE <ROBJkE@users.noreply.github.com>
Named-volume / operator log still prints {shop-id}-{env}; compose argv
does not take -p.

Co-authored-by: ROBJkE <ROBJkE@users.noreply.github.com>
@ROBJkE
ROBJkE merged commit a713ab3 into main Sep 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants