diff --git a/fyrst/shopware-cd/1.0/manifest.json b/fyrst/shopware-cd/1.0/manifest.json new file mode 100644 index 00000000..4688fc46 --- /dev/null +++ b/fyrst/shopware-cd/1.0/manifest.json @@ -0,0 +1,15 @@ +{ + "copy-from-package": { + "overlay/": "" + }, + "bundles": { + "Fyrst\\ShopwareCd\\FyrstShopwareCdBundle": [ + "all" + ] + }, + "env": { + "SHOPWARE_SHOP_ID": "", + "SHOPWARE_DEPLOY_ENV": "live", + "SHOPWARE_DATA_BASE": "/var/lib/shopware/data" + } +} diff --git a/fyrst/shopware-cd/1.0/post-install.txt b/fyrst/shopware-cd/1.0/post-install.txt new file mode 100644 index 00000000..26e12ded --- /dev/null +++ b/fyrst/shopware-cd/1.0/post-install.txt @@ -0,0 +1,124 @@ + * fyrst/shopware-cd + Flex copied CD files from the package + overlay/ into the shop root: CI, + deploy/ (including CD Compose), .dockerignore, + and .env.example + (same idea as shopware/docker copying docker/Dockerfile). + + compose.yaml, .gitignore, and + .shopware-project.yml (create’s default; + .shopware-project.yaml is also accepted — do not rename) + are owned by + shopware-cli project create / the CLI — not this recipe. + + Local: shopware-cli project dev and the CLI-managed + shop-root compose.yaml. + VPS/CD: files under deploy/ + (deploy/compose.yaml, deploy/compose.prod.yaml, + deploy/compose.vps.yaml). + Runtime DB/bind-mount copy between VPS hosts: + fyrst-cli shopware sync pull + (see deploy/sync-runtime.md). + DB snapshots use shopware-cli project dump + (fyrst-cli never dumps; restore is + fyrst-cli shopware db import). + Live backups (not sync): + fyrst-cli shopware backup create + (see deploy/backup-runtime.md). + Rollback: + IMAGE_TAG=$(cat .previous-tag) fyrst-cli shopware deploy rollback. + Each VPS needs fyrst-cli 0.1.0+ + (https://github.com/fyrst-dev/cli). + CI runs fyrst-cli shopware deploy release + with IMAGE / IMAGE_TAG / + COMPOSE_DIR. + TLS edge: deploy/edge/Caddyfile. + Live → local project dev rsync (no DB): + fyrst-cli shopware sync local + (reads SHOPWARE_SHOP_ID from local .env; + remote root /var/lib/shopware/data/${SHOPWARE_SHOP_ID}/live; + --data all is refused). + + Flex may append a ###> fyrst/shopware-cd ### + block to shop-root .env (empty + SHOPWARE_SHOP_ID, SHOPWARE_DEPLOY_ENV=live, + SHOPWARE_DATA_BASE=/var/lib/shopware/data). + It does not overwrite create’s whole .env + and does not put secrets in that block. Then run + fyrst-cli shopware env init --shop-id … + (see deploy/README). + VPS .env source of truth (required): + SHOPWARE_SHOP_ID (same slug on live + staging + laptop), + SHOPWARE_DEPLOY_ENV (live|staging|playground|dev). + Compose derives project name + (${SHOPWARE_SHOP_ID}-${SHOPWARE_DEPLOY_ENV}) + and bind-mount paths from those two plus optional + SHOPWARE_DATA_BASE (default + /var/lib/shopware/data) — three separate interpolations, + no nested defaults. It does not require + COMPOSE_PROJECT_NAME or SHOPWARE_DATA_ROOT + (optional for scripts/docs; fyrst-cli derives when unset and prefers them + when set — do not assign them empty). + WARNING: shopware-cli project create writes + COMPOSE_PROJECT_NAME=sw-shop-… into shop-root + .env for local project dev. That env var + overrides Compose name: + (${SHOPWARE_SHOP_ID}-${SHOPWARE_DEPLOY_ENV}). + On the VPS, comment out that line + (fyrst-cli shopware env init --vps or by hand). + Flex does not delete it on composer require + (create owns the local flow). + Bootstrap: + DATA="${SHOPWARE_DATA_BASE:-/var/lib/shopware/data}/${SHOPWARE_SHOP_ID}/${SHOPWARE_DEPLOY_ENV}" + then mkdir -p "${DATA}"/{files,media,thumbnail,theme,sitemap} + then chown -R 82:82 "${DATA}". + Live profiles: uncomment + COMPOSE_PROFILES=redis,worker,scheduler + in .env (worker + scheduler; redis if used). Staging leaves + this unset unless you need async tasks. + fyrst-cli shopware deploy release warns on live when it is empty; it does + not auto-enable. + Same-host tag-and-load / air-gap: PULL_POLICY=never + and SKIP_PULL=1 (or + fyrst-cli shopware deploy release --skip-pull). Default + pull_policy is always for CI/VPS. + Several shops or live+staging on one VPS share the host; shop id + env + keep stacks isolated. + + You MUST require shopware/docker in the same Composer command as + this package. That recipe copies docker/Dockerfile, which CI and + CD Compose require (default DOCKERFILE=docker/Dockerfile). This recipe + does not ship a root Dockerfile. A missing docker/Dockerfile + means shopware/docker was skipped. + + Flex may append SoT keys to .env; it does not + overwrite create’s whole .env. Then run + fyrst-cli shopware env init --shop-id … + (VPS: add --vps; see deploy/README). + If .env is missing, that command copies + .env.example first. Commit the copied files; + vendor/ is gitignored. + + shopware-cli project create writes .shopware-project.yml + (that extension is fine). shopware-cli accepts both + .yml and .yaml; do not rename. + GitHub Actions picks up + .github/workflows/cd.yaml. GitLab still defaults to + .gitlab-ci.yml: set Settings → CI/CD → CI/CD configuration file + to .gitlab-ci.yaml (or copy/symlink that name). + + Flex registers + Fyrst\ShopwareCd\FyrstShopwareCdBundle + in config/bundles.php. + Post-restore sales-channel URL rewrite uses + APP_URL in shop-root .env; + sync calls + bin/console fyrst:sales-channel:rewrite-urls. + Laptop SSH (SHOPWARE_SSH_*) belongs in + .env.local. + Shops need composer update fyrst/shopware-cd + so the command and bundle exist, then + composer recipes:update fyrst/shopware-cd. + + Refresh later with composer recipes:update fyrst/shopware-cd. + See https://github.com/fyrst-dev/shopware-cd