andreaskoch / dockerized-magento

A dockerized Magento Community Edition 1.9.x
BSD 3-Clause "New" or "Revised" License
278 stars 144 forks source link

Install without Sample Data? #13

Closed brandontamm closed 8 years ago

brandontamm commented 8 years ago

Anyone know which lines to remove/include from the installer shell script to still automate the installation but start with a fresh clean database (instead of sample data?)

riker09 commented 8 years ago

Yes, see file docker-images/installer/bin/install.sh, lines 103-126:

[...]

echo "Installing Sample Data: Media"
curl -s -L https://raw.githubusercontent.com/Vinai/compressed-magento-sample-data/1.9.1.0/compressed-no-mp3-magento-sample-data-1.9.1.0.tgz | tar xz -C /tmp
cp -av /tmp/magento-sample-data-*/* $MAGENTO_ROOT
rm -rf /tmp/magento-sample-data-*

[...]
brandontamm commented 8 years ago

I wish it were that easy to just remove that block of code but its not quite that simple :)

I actually accomplished this by using magerun to install a fresh database and that worked perfectly and some functions.

First, remove the following blocks of code from ./docker-images/installer/bin/install.sh:

Then, take a look at these diffs (if anyone wants the code or uses this I'll create a pull request:) screen shot 2016-09-09 at 9 00 49 am

screen shot 2016-09-09 at 9 01 59 am

brandontamm commented 8 years ago

So I needed a function to wait for MYSQL and then I used Magerun to automate Magento installation with the docker-compose.yml variables:

echo "Starting Installation"

mysqlWait

magerun --skip-root-check --root-dir="$MAGENTO_ROOT" install --noDownload --dbHost="$MYSQL_HOST" --dbUser="$MYSQL_USER" --dbPass="$MYSQL_PASSWORD" --dbName="$MYSQL_DATABASE" --installSampleData="no" --useDefaultConfigParams="yes" --installationFolder="$MAGENTO_ROOT" --baseUrl="http://$DOMAIN"

andreaskoch commented 8 years ago

Hi @brandontamm, for now I don't think I will add this option to this project since it was made to create a quick start for a dockerized Magento 1.

But I will create a new project which works similar to my dockerize-magento2 project which will not include sample data.

Once that's ready I will reference it here.