-
Notifications
You must be signed in to change notification settings - Fork 0
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.
To start new project from boilerplate:
- Download the package contents (or fork from it), copy Magento sources at the same level
(so
setup
folder andVagrantfile
will be on the same level withapp
) - 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
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
- Prepare configuration files
- Note, that during installation puppet will rewrite
app/etc/local.xml
file, so backup it for now. You can customize it later. - Install Vagrant, Virtualbox and
nfs
(if not yet installed). - 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
- SSH to VM and import database. Or, setup and use a backup-restore script.
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.
Vagrant and puppet scripts are configured via 2 files:
- Vagrantfile for Vagrant configuration.
- Hiera config for puppet configuration.
In this file you should edit 2 things:
- IP address of your guest VM in
config.vm.network
param (Vagrant private networking is used). - Path in guest machine where the source code will be placed. It's set up in 2 params:
config.vm.synced_folder
andpuppet.working_directory
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.