This repo is a fixture consumed by ddev/ddev's own test suite
(pkg/ddevapp/ddevapp_test.go, the testpkgmagento2 case), which downloads a
tagged release of this repo's .tarballs/* artifacts and expects these exact
URLs to work in a fresh ddev magento2 project:
/junk.txt→This is a junk/index.php/unicycle.html→ containsunicycle/media/catalog/product/u/n/unicycle.jpg→ the product image
When you cut a new release here, the ddev/ddev test file's tag and tarball
URLs (currently pinned to an old tag) need to be updated to match — that's a
separate PR in ddev/ddev.
- Magento Open Source: 2.4.9
- PHP: 8.4
- Database: MariaDB 12.3
- Search engine: OpenSearch (via the
ddev/ddev-opensearchadd-on — Magento dropped Elasticsearch support; older versions of this fixture used theddev/ddevcore Elasticsearch service)
-
Make sure
.ddev/homeadditions/.composer/auth.jsonhas validrepo.magento.compublic/private keys underhttp-basic. This path is already wired up viaweb_environment: COMPOSER_HOME=...in.ddev/config.yaml, and the file is gitignored so keys never get committed. Get keys from your Adobe Commerce Marketplace account (Access Keys) if you don't have them. -
Delete the existing Magento source tree so
ddev composer create-projectcan run again (see gotcha below):rm -rf app bin dev generated lib phpserver pub setup var vendor \ .editorconfig .htaccess .htaccess.sample .php-cs-fixer.dist.php .user.ini \ auth.json.sample CHANGELOG.md composer.json composer.lock COPYING.txt \ grunt-config.json.sample Gruntfile.js.sample LICENSE_AFL.txt LICENSE.txt \ nginx.conf.sample package.json.sample SECURITY.md
-
Reconfigure DDEV (bump versions here as needed — check current requirements at https://experienceleague.adobe.com/en/docs/commerce-operations/installation-guide/system-requirements):
ddev config --project-type=magento2 --docroot=pub --upload-dirs=media \ --disable-settings-management --php-version=8.4 --database=mariadb:12.3 rm -rf .ddev/elasticsearch .ddev/docker-compose.elasticsearch.yaml \ .ddev/addon-metadata/elasticsearch ddev add-on get ddev/ddev-opensearch ddev start
-
Gotcha:
ddev composer create-projectrefuses to run unless the project root is (almost) empty. It hard-codes a skip-list of directories it ignores (.claude .ddev .devcontainer .DS_Store .git .idea .tarballs .vscode), but plain files at the root — including this README.md and .gitignore — are NOT on that list and will abort the command with'X' is not allowed to be present. Temporarily move them out of the project root (e.g. to/tmp) before running create-project, then move them back afterward:mv README.md .gitignore /tmp/ ddev composer create-project --repository https://repo.magento.com/ \ magento/project-community-edition . --no-interaction mv /tmp/README.md /tmp/.gitignore .
Also note: passing a subdirectory name (as the old ddev quickstart docs used to show) is rejected by current
ddevwith "Installing the project in the 'X' subdirectory is unsupported" — use.for the target directory. -
Install Magento:
ddev magento setup:install --base-url="https://testpkgmagento2.ddev.site/" \ --cleanup-database --db-host=db --db-name=db --db-user=db --db-password=db \ --opensearch-host=opensearch --search-engine=opensearch --opensearch-port=9200 \ --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com \ --admin-user=admin --admin-password=Password123 --language=en_US ddev magento deploy:mode:set developer ddev magento module:disable Magento_TwoFactorAuth Magento_AdminAdobeImsTwoFactorAuth ddev config --disable-settings-management=false ddev magento setup:config:set --backend-frontname="admin_ddev" --no-interaction
-
Create a simple product named
unicyclewith SKUunicycleand a picture namedunicycle.jpg. You can do this by hand in the admin UI (Catalog → Products → Add Product → Simple Product) with a picture from https://m.media-amazon.com/images/I/715LWvYxcLL._AC_SY879_.jpg or anywhere else, or via the REST API, which is scriptable and was used to build this fixture:TOKEN=$(ddev exec -- curl -sk -X POST "https://testpkgmagento2.ddev.site/rest/V1/integration/admin/token" \ -H "Content-Type: application/json" -d '{"username":"admin","password":"Password123"}' | jq -r .) ddev exec -- curl -sk -X POST "https://testpkgmagento2.ddev.site/rest/V1/products" \ -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d '{ "product": {"sku":"unicycle","name":"unicycle","attribute_set_id":4, "price":199.99,"status":1,"visibility":4,"type_id":"simple","weight":5, "extension_attributes":{"stock_item":{"qty":100,"is_in_stock":true}}}}' # Then base64-encode the image and POST it to # /rest/V1/products/unicycle/media as a media_gallery_entries "content" payload.
The product's URL key must resolve to
/index.php/unicycle.htmland the uploaded image must land atpub/media/catalog/product/u/n/unicycle.jpg—ddev/ddev's test suite checks both paths literally. -
Add a junk file so the test suite has something trivial to fetch:
echo "This is a junk" >pub/junk.txt
-
Build the tarballs:
VERSION=2.4.9 mkdir -p .tarballs tar -czf .tarballs/testpkgmagento2_code_no_media.magento${VERSION}.tgz \ --exclude=.ddev --exclude=.git --exclude=dev --exclude=var \ --exclude=pub/media --exclude=pub/static --exclude=.tarballs \ --exclude=app/etc/env.php --exclude=.idea --exclude=.vscode . ddev export-db --gzip=false --file=.tarballs/db.sql && \ tar -czf .tarballs/testpkgmagento2.magento${VERSION}.db.tgz -C .tarballs db.sql && \ rm .tarballs/db.sql tar -czf .tarballs/testpkgmagento2_files.magento${VERSION}.tgz -C pub/media .
Why
--exclude=pub/staticmatters: Magento's static-asset publisher, when running in Developer mode, materializes plain (unprocessed) static view files — vendor JS libraries, etc. — as symlinks with absolute target paths rooted at Magento's base path (/var/www/htmlinside any ddev container), e.g.pub/static/adminhtml/Magento/backend/en_US/requirejs/require.js -> /var/www/html/lib/web/requirejs/require.js. This is normal, intentional Magento behavior (not a bug in this repo's tar invocation, and not specific to any one Magento version) — it happens automatically the first time each asset is requested (e.g. by loading the admin login page). Because it symlinks to an absolute path, it only happens to work when re-extracted into another container that also mounts the project at/var/www/html(true for ddev, not guaranteed elsewhere), and tarring up symlinks at all is fragile.pub/staticis a regenerable build artifact just likepub/media/var/generated, so the simplest fix is excluding it entirely — Magento rebuilds it on first request. (Note:bin/magento setup:static-content:deploydoes NOT reproduce this — it always copies real files. The symlinks only appear via the lazy, on-request publishing pipeline in Developer mode.) -
Create an empty release tagged with
$VERSIONand upload the tarballs (ghCLI required):gh release create ${VERSION} --title ${VERSION} --notes "Magento ${VERSION}" gh release upload ${VERSION} .tarballs/*gz
-
Update
ddev/ddev'spkg/ddevapp/ddevapp_test.go(thetestpkgmagento2test case) to pointSourceURL,DBTarURL, andFilesTarballURLat the new tag/filenames.