Help language development. Donate to The Perl Foundation

Magento cpan:SACOMO last updated on 2018-06-07


source xt/env;

# Wait until mysql available
docker exec -it -e SCRIPT="$(cat scripts/mysql-running-test)" perl6-magento_db_1 /bin/bash -c " 
    echo \"\$SCRIPT\" > mysql-running-test; 
    chmod +x mysql-running-test; 

# Wait until composer initialized
while [[ "$variable" -ne "0" ]];do
    echo "Cannot connect to db";
    variable=$(docker exec -i -t perl6-magento_web_1 /bin/bash -c 'file /var/www/html/var/composer_home; echo $?')
    sleep 0.1 

# Setup Magento
docker exec -it -u 0 -e SCRIPT="$(cat scripts/install-magento)" perl6-magento_web_1 /bin/bash -c " 
    echo \"\$SCRIPT\" > install-magento; 
    chmod +x install-magento; 

# Magento sample data
docker exec -it -e SCRIPT="$(cat scripts/install-sampledata)" perl6-magento_web_1 /bin/bash -c " 
    echo \"\$SCRIPT\" > install-sampledata; 
    chmod +x install-sampledata; 

# Add test user
docker exec -it -e CUSTOMERSQL="$(cat xt/sql/customer-entity.sql)" perl6-magento_db_1 /bin/bash -c "
    echo \"\$CUSTOMERSQL\" > /tmp/customer.sql;
    mysql -u root -p${MYSQL_ROOT_PASSWORD} -h db magento  < /tmp/customer.sql";