M2IF - Magento 2 Console Extension
, (*1)
Development
To make the development process as easy as possible, we've added some basic Robo commands., (*2)
General Configuration
Robo supports a configuration file robo.yml
, that has to be located in the root directory of the extension.
By default, the file contains the following default configurations, that probably have to be customized to
your needs, (*3)
dirs:
deploy: /opt/appserver/webapps/magento2-ce-2.1.7
docker:
target-container: appserver-1.1.4-magento
dirs:
deploy: /opt/appserver/webapps/magento2-ce-2.1.7
src: /root/Workspace/import-cli-magento/src
dest: webapps/magento2-ce-2.1.7
Sync Sources
To synchronize your local sources with the Magento 2 instance inside the Docker container, simply execute, (*4)
$ vendor/bin/robo docker:sync
Execute Magento Commands
Another command allows you to invoke the magento script inside the Magento root directory of the docker container. Simply pass
the Magento command, prefixed with a --
, e. g., (*5)
$ vendor/bin/robo docker:magento -- setup:upgrade
Execute Composer Commands
Same works for composer. Simply pass the command and the arguments/options, prefixed with a --
e. g., (*6)
$ vendor/bin/robo docker:composer -- update --no-dev
Installation
The general development process is optimized to work with Docker. Therefore we'll assume a running Docker container with
a working Magento 2 instance inside. If not available or you're not sure how to setup one, have a look at the appserver.io
tutorial., (*7)
Option 1 - Using the Robo command
$ vendor/bin/robo docker:composer require techdivision/import-cli-magento:dev-master
This is the preferred option., (*8)
Option 2 - Direct Installation from inside the container
Open a shell in your Docker container, (*9)
$ docker exec -ti appserver-1.1.4-magento bash
Then use your favorite editor, e. g. vim, to open the composer.json of your Magento 2 installation and add the extension to
the required dependencies like, (*10)
{
...
"require": {
...
"techdivision/import-cli-magento": "dev-master"
}
...
}
and finish the installation by updating composer on the commandline with, (*11)
$ composer update
The extension should now be installed ready for development., (*12)