-
Notifications
You must be signed in to change notification settings - Fork 7
Project set up for development in a local environment
Keeping extension modules in a repository with the whole Magento project creates additional challenges to support and maintain the codebase. It has to be continuously synchronized with the Magento core and all of the commits must be monitored, to make sure that none of the core components are affected at any time.
To combat these kind of issues, the new approach has been developed and documented in the Architecture repository [link]. The described technique allows to keep extension code separately, in a form of Composer metapackage containing a set of modules. This allows for simple installation and development in a local environment both for Git-based and Composer-based Magento deployments.
-
📙 Magento git repository is cloned and
2.3-develop
branch is checked out. Checking out any2.3
release tags should work fine as well.git clone git@github.com:magento/magento2.git .
-
🆕 Create
ext
directory in the root directory of Magento:mkdir ext
-
⬇️ Git clone the
aep-launch
repository into the appropriate directory insideext
:git clone git@github.com:magento/aep-launch.git ext/adobe/aep-launch
-
🔧Update Composer settings for the project to allow a better development workflow:
-
minimum-stability
for packages is updated todev
value. This allows to install development modules:composer config minimum-stability dev
-
Local package sources are configured, to let Composer know where to find the modules. The following command will configure the extension code, inside
ext
directory, to be treated as a package and symlinked to thevendor
directory:composer config repositories.ext path "./ext/*/*/*"
-
-
🎉Finally, install the
aep-launch
metapackage:composer require adobe/aep-launch
✅ At this point, all of the aep-launch
modules are symlinked to vendor
directory, which allows both running Magento installation with additional modules and development using the git workflow.
In order to improve Developer Experience when working with this repository structure, a few additional items may be configured:
-
Exclude
ext
directories from root directory Git:echo ext >> ./.git/info/exclude
-
Skip root directory
composer.*
files to avoid committing them by mistake:git update-index --skip-worktree composer.json git update-index --skip-worktree composer.lock
This operation is reversible, if needed:
git update-index --no-skip-worktree composer.json git update-index --no-skip-worktree composer.lock
After installing, you need to create an integration and configure the Adobe Experience Platform extension. See the Setting up the Adobe Experience Platform Magento Extension guide.