From 1dd075d9f74674916ec315a9b3c8885c396188d5 Mon Sep 17 00:00:00 2001 From: Kirk Madera Date: Mon, 7 Dec 2015 11:29:31 -0600 Subject: [PATCH 1/2] Adds explicit setup instructions to address #52 --- README.md | 53 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 2d88a33..7501bb2 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,17 @@ A simple way to get magento2 up and running. It consists of a Debian Wheezy box The Magento 2 repository is a git submodule and can be edited/explored from the host machine. It is accessed by the guest via shared directories. ### Usage +#### Prerequisites +Install the following before proceeding through installation. This may require a restart after installing all software. + +* Vagrant: https://www.vagrantup.com/downloads.html +* VirtualBox: https://www.virtualbox.org/wiki/Downloads +* Git Bash (Windows users): https://git-scm.com/downloads +* Github account: https://github.com/ + #### Installation 1. Clone this repository: `git clone --recursive https://github.com/rgranadino/mage2_vagrant.git` -2. Navigate into the repository via `cd` +2. Navigate into the repository via `cd mage2_vagrant` 2. **IMPORTANT**: If you cloned the repository without the *--recursive* param, you need to initialize the required submodules: `git submodule update --init --recursive` 3. Start up virtual machine: `vagrant up` 4. Point a host name to 192.168.56.10 in /etc/hosts `echo '192.168.56.10 mage2.dev' >> /etc/hosts` @@ -15,26 +23,39 @@ The Magento 2 repository is a git submodule and can be edited/explored from the 6. Add your Magento Connect authentication credentials to the global composer auth.json: * Open or create the file `~/.composer/auth.json` - * Add the Magento Connect authentication credentials (if you don't have any, please check [here](http://devdocs.magento.com/guides/v2.0/install-gde/prereq/connect-auth.html) on how to create them): - - ```json - { - "http-basic": { - "repo.magento.com": { - "username": "", - "password": "" - } - } - } - ``` + * Add the Magento Connect authentication credentials (if you have not already, follow this guide to [create your Magento Connect authentication keys](http://devdocs.magento.com/guides/v2.0/install-gde/prereq/connect-auth.html)): + + ```json + { + "http-basic": { + "repo.magento.com": { + "username": "", + "password": "" + } + } + } + ``` * Or you can use the composer config command: `composer.phar global config http-basic.repo.magento.com ` -7. Install Magento 2 by running: +7. Run composer + ```bash + cd /vagrant/data/magento2; # This is the document root + composer install -v; + ``` + * If you did not set your ~/.composer/auth.json file, you will be prompted for credentials to repo.magento.com. Hit ctrl+C to cancel and go back to step 7. + * You will be prompted for a Github token. Follow the instructions given in the shell. - * Via CLI (recommended) +8. Install Magento 2 by running: - * `reinstall` (Magento **without** sample data) or `reinstall -s` (Magento **with** sample data). + * Via CLI (recommended) + + * If on Windows, you will need to run the following in order for the reinstall command to work. If you do not, you will see an error like `-bash: /home/vagrant/bin/reinstall: /bin/bash^M: bad interpreter: No such file or directory` + ``` + sudo apt-get install dos2unix; + dos2unix /home/vagrant/bin/reinstall; + ``` + * `reinstall` (Magento **without** sample data) or `reinstall -s` (Magento **with** sample data). * Via Web Installer From 89b77dd772aa4d003ba12e22c5274dc8f05cce67 Mon Sep 17 00:00:00 2001 From: Kirk Madera Date: Tue, 8 Dec 2015 21:20:56 -0600 Subject: [PATCH 2/2] Added notes on sample data and deploying static assets - Added notes on sample data and deploying static assets - Also added dos2unix now for WIndows users for the bin/magento command --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7501bb2..3f30efa 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Install the following before proceeding through installation. This may require a cd /vagrant/data/magento2; # This is the document root composer install -v; ``` - * If you did not set your ~/.composer/auth.json file, you will be prompted for credentials to repo.magento.com. Hit ctrl+C to cancel and go back to step 7. + * If you did not set your ~/.composer/auth.json file, you will be prompted for credentials to repo.magento.com. Hit ctrl+C to cancel and go back to step 6. * You will be prompted for a Github token. Follow the instructions given in the shell. 8. Install Magento 2 by running: @@ -54,6 +54,7 @@ Install the following before proceeding through installation. This may require a ``` sudo apt-get install dos2unix; dos2unix /home/vagrant/bin/reinstall; + dos2unix /vagrant/data/magento2/bin/magento; ``` * `reinstall` (Magento **without** sample data) or `reinstall -s` (Magento **with** sample data). @@ -61,6 +62,22 @@ Install the following before proceeding through installation. This may require a * Please go to the Magento directory within the vagrant box (`cd /vagrant/data/magento2/`) and run `composer install`. Then open 'http://mage2.dev/setup' in your browser and go through the installation process. +Note: If you do not see sample data after running the above command, run the following: + +``` +cd /vagrant/data/magento2; +mkdir -p var/composer_home; +cp ~/.composer/auth.json var/composer_home; +bin/magento sampledata:deploy; +bin/magento setup:upgrade; +``` + +Note: If you have issues with images not displaying on the site, run the following: +``` +cd /vagrant/data/magento2; +bin/magento setup:static-content:deploy +``` + #### Updating 1. From the host machine run `git pull && git submodule update --init && vagrant provision`. * If there is an update to the *manifests/mage.pp* or *files/** files it is recommended to provision the guest machine. This can be done by running: `vagrant provision`. There is also a cron that runs every 15 minutes to