WeareJH / workflow

A composer helper to improve development workflow
21 stars 4 forks source link

Magento Full Install Command Fails to Install Magento #40

Open dcabrejas opened 7 years ago

dcabrejas commented 7 years ago

When running the command workflow mfi I got the following error:

--cleanup-database: command not found

I found this happens when workflow executes the .docker/php/bin/magento-install file from within the container.

Workaround is to ssh into the container and run the commands found on that file manually from the command line as follows :

bin/magento setup:install \
    --db-host=db \
    --db-name=$MYSQL_DATABASE \
    --db-user=$MYSQL_USER \
    --db-password=$MYSQL_PASSWORD \
    --base-url=$MAGE_HOST \
    --base-url-secure=$MAGE_HOST \
    --admin-firstname=$MAGE_ADMIN_FIRSTNAME \
    --admin-lastname=$MAGE_ADMIN_LASTNAME \
    --admin-email=$MAGE_ADMIN_EMAIL \
    --admin-user=$MAGE_ADMIN_USER \
    --admin-password=$MAGE_ADMIN_PASS \
    --backend-frontname=$MAGE_BACKEND_FRONTNAME \
    --use-secure=1 \
    --use-secure-admin=1 \ 
    --cleanup-database -vvv \
    || { exit 1; }

and then

bin/magento index:reindex && \
bin/magento dev:source-theme:deploy --area="adminhtml" --theme="Magento/backend" css/styles-old css/styles && \
bin/magento dev:source-theme:deploy --theme="Magento/blank" css/styles-m css/styles-l css/email css/email-inline && \
bin/magento dev:source-theme:deploy && \
bin/magento setup:static-content:deploy
antbates91 commented 7 years ago

I copy pasted the entire file in the terminal and it worked totally fine.

as in


echo "Installing Magento..."

bin/magento setup:install \
    --db-host=db \
    --db-name=$MYSQL_DATABASE \
    --db-user=$MYSQL_USER \
    --db-password=$MYSQL_PASSWORD \
    --base-url=$MAGE_HOST \
    --base-url-secure=$MAGE_HOST \
    --admin-firstname=$MAGE_ADMIN_FIRSTNAME \
    --admin-lastname=$MAGE_ADMIN_LASTNAME \
    --admin-email=$MAGE_ADMIN_EMAIL \
    --admin-user=$MAGE_ADMIN_USER \
    --admin-password=$MAGE_ADMIN_PASS \
    --backend-frontname=$MAGE_BACKEND_FRONTNAME \
    --use-secure=1 \
    --use-secure-admin=1 \
    --cleanup-database -vvv \
    || { exit 1; }

bin/magento index:reindex && \
bin/magento dev:source-theme:deploy --area="adminhtml" --theme="Magento/backend" css/styles-old css/styles && \
bin/magento dev:source-theme:deploy --theme="Magento/blank" css/styles-m css/styles-l css/email css/email-inline && \
bin/magento dev:source-theme:deploy && \
bin/magento setup:static-content:deploy

echo "Installation complete  ᕦ( ̿ ̿ - ̿ ̿ )つ"

but running workflow mfi I get the same error as @dcabrejasazagra

mikeymike commented 7 years ago

For reference this happens because there's a stray space left after the generating of that file, specifically at --use-secure-admin iirc ... To fix we need to adjust the string replace done for Rabbit MQ