Repository navigation
feat: local and VPS Compose project is {shop-id}-{env} - #37
Merged
Merged
Conversation
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
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>
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>
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shared shop-root
.envis 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 initSHOPWARE_SHOP_ID(same slug everywhere) and optionalIMAGEin committed.env.COMPOSE_PROJECT_NAME(create’ssw-…) and leftoverSHOPWARE_DEPLOY_ENVin shared.env. Never writesCOMPOSE_PROJECT_NAMEorSHOPWARE_DEPLOY_ENVinto shared.env.SHOPWARE_DEPLOY_ENVfrom--envandCOMPOSE_PROJECT_NAME={shop-id}-{env}(e.g.acme-dev,acme-live) to.env.local(gitignored; created if missing). Defaultlivewhen unset and no host value; leftover shared.envdeploy env is migrated then commented.name: {shop-id}-{env}in gitignoredcompose.override.yaml(create if missing; if the file exists, set/replace only that key). Compose andshopware-cli project devauto-readCOMPOSE_PROJECT_NAMEonly from project-directory.env, not.env.local, so the YAMLname:is what names the local stack. shopware-cli regeneratescompose.yamland leavescompose.override.yamlfor local customization..env.exampleskipsCOMPOSE_PROJECT_NAME/SHOPWARE_DEPLOY_ENV.Loader
.env→.env.local→.env.prod). EmptySHOPWARE_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)
name:interpolating host env files: VPSdeploy/compose.yamlname: "${SHOPWARE_SHOP_ID:?…}-${SHOPWARE_DEPLOY_ENV:?…}", local gitignoredcompose.override.yamlname:.--env-file .env, then--env-file .env.local/--env-file .env.prodwhen those files exist under the shop root (same order as identity load).-p/--project-nameon VPS release/rollback, db import, rewrite, restore, or sync compose paths.vps_compose_argvandcompose_argvtake the shop root (no project-name parameter). LeftoverCOMPOSE_PROJECT_NAMEin committed.envis commented out by env init.Unchanged: no MYSQL/
APP_URLinvention, noAPP_SECRETgeneration, no--vps/--generate-app-secret, no release-tag bump. recipes/shopware-cd not touched.cargo test --lockedpassed (201 unit tests plus integration).