Skip to content
obukhow edited this page Oct 3, 2014 · 22 revisions

Installation

Boilerplate could be used to start new Magento project, as well as it could be attached to existing project to provide portable local environment.

Starting new Magento project

To start new project from boilerplate:

  • Download the package contents (or fork from it), copy Magento sources at the same level (so setup folder and Vagrantfile will be on the same level with app)
  • Or, if you already have Magento source codes downloaded, merge boilerplate inside:
$ git remote add boilerplate [email protected]:OggettoWeb/boilerplate.git
$ git fetch boilerplate
$ git merge boilerplate/master
  • Execute the following commands from terminal to install git sub-modules:
$ git submodule init
$ git submodule update
  • If you are using sample data, copy extracted sql file to setup/sql/sample_data.sql. Note, that it will be deleted after installation.
  • Prepare configuration files
  • Install Vagrant, Virtualbox and nfs (if not yet installed).
  • Note, that for clean magento installation app/etc/local.xml file should not exist. Use different flow if you want to attach boilerplate to existing project.
  • Run VM setup:
$ vagrant up
  • Take rest. By default puppet is started with debug option so it will show lots of logs while installing.
  • Setup virtual host on your computer (based on configured IP and Magento base URL)
  • Visit configured host once everything is installed
  • Install more/modify puppet scripts if needed
  • Commit boilerplate files to your repository and share usage with teammates

Attaching to existing project

To use boilerplate with existing project follow the steps below. If your project requires some extra setup to run you may read VM info chapter to see what will be installed by default and customize the VM to meet the project needs. Or, try default installation and then fix dependencies.

  • Merge boilerplate package contents with your project
$ git remote add boilerplate [email protected]:OggettoWeb/boilerplate.git
$ git fetch boilerplate
$ git merge boilerplate/master
  • Execute the following commands from terminal to install git sub-modules:
$ git submodule init
$ git submodule update
$ vagrant up
  • Take rest. By default puppet is started with debug option so it will show lots of logs while installing.
  • Setup virtual host on your computer (based on configured IP and Magento base URL)
  • Visit configured host once everything is installed
  • Install more/modify puppet scripts if needed
  • Commit boilerplate files to your repository and share usage with teammates
  • SSH to VM and import database. Or, setup and use a backup-restore script.

Setting UP database backups

Boilerplate has a script which downloads and extracts database/media archives by ftp/http. To use this feature you should place DB/media dumps somewhere and specify URLs in the following params in hiera:

  • project::resources::db::backup_path — URL of DB backup in .gz format
  • project::resources::media::backup_path — URL of media backup in .tar.gz format
  • project::resources::db::emails_domain — Dummy emails domain (like "@foo.com")

They you can sync with them at any time.

Configuration files

Vagrant and puppet scripts are configured via 2 files:

Vagrantfile

In this file you should edit 2 things:

  1. IP address of your guest VM in config.vm.network param (Vagrant private networking is used).
  2. Path in guest machine where the source code will be placed. It's set up in 2 params: config.vm.synced_folder and puppet.working_directory

Hiera YAML-file

To setup puppet scripts you should edit setup/provision/hiera/node/localhost.yaml file and specify what's appropriate for your installation. Please note, that project::magento::root param should be the same as source code path in your Vagrantfile.