The goal of this project is to make a very simple way for someone to do development against the production version of the Magento solution. This setup is done in a way that should let the user follow only a few steps before then can login to the admin area and begin development work.
-
install the base apps
- GITHUB (win|mac)
- Vagrant (for help installing see wiki)
- VirtualBox (for help installing see wiki)
- Ruby(only needed if using windows see the wiki for help) Note: if your on a mac you must have ruby 1.9 or above. Look to this article to update your ruby
-
run in powershell/command line
> git clone git://github.com/jeremyBass/vagrant-base-web.git webbase
-
move to the new directory
> cd webbase
-
run in powershell/command line/terminal
> rake start
Some this to note is that you wil be asked questions. If you need help, look to the task options wiki page
Now if this is the first time you have ever run then the rake start
task will install anything
that is needed and check to make sure everything is ok. It'll prompt you as it goes, but after a
few minutes the first time around, you will have the admin area for Magento up and ready to log in.
It really is as simple as these 4 steps to get up and running. On a fresh system, seeing the Magento
admin page took about 5-10 minutes depending on the power of the machine your ran it on and it's internet
connections. There will be a tune it up section in the wiki area later on.
If you have use Vagrant, then you'll know that most of the time you need to mess with config files,
install plugins, and have to do some of your own clean up if you want to start from scratch.
What this project is designed to do it wrap Vagrant in a rake
task for Ruby. By doing this we can
perform tests that the host system is ready to vagrant up
and can ask questions verse requiring
the developer to mess around with the configs. This means you can totally bring up and down a box much
faster by automating as much as possible.
##The Ruby wrapper ###Rake Tasks Although you could just use the Vagrant commands, the whole point of this project is that there are questions about the environment you want to set up. In order to take advantage of this, here are a list of the rake tasks:
Primary Tasks
rake start
:: basicallyvagrant up
but with prompts (this runs a few other tasks to ensure that the system is ready tovagrant up
)rake end
:: this task isvagrant destroy
with options to clean up the database if it needs it.rake hardclean
:: runs all the cleanersrake fresh
:: takes the system back to basic (will prompt to uninstall gems and vagrant plugins)rake restart
:: this task will time the running ofrake end
and thenrake up
which should provide a very fast full down and up
Tasks to match Vagrant
rake up
:: vagrant up (only adds timer and events)rake destroy
:: vagrant destroy (only adds timer and events)rake halt
:: vagrant halt (only adds timer and events)rake reload
:: vagrant reload (only adds timer and events)rake suspend
:: vagrant suspend (only adds timer and events)rake pull
:: match the local to the productionrake push
:: push up to production (would need to authenticate)
Utility tasks
rake clean_db
:: This is to clear the shared database folderrake clean_www
:: This is to clear the shared web folderrake create_install_settings
:: create the settings for the installerrake test
:: this is for testing that all the plugins are there, if not then install them?rake open
:: Opens up your default browser and loads your url from settings
Because this is a ruby rake task wrapper for Vagrant, we can add a few helpers to improve the process.
One of the first things is that there are event hooks that you can inject your personal parts to.
All event files are located in /rake/events
and will have the file name in the format of {Event_type}_{Task_name}.rb
.
The events that are set up for you are
- Pre
- Post
So for example if you wanting to do something before everything else when rake start
is ran, then you would need
to add your event file named, /Pre_start.rb
There is a sample file to look at as well in the /rake
folder (EXAMPLE_Pre_start.rb
).
From there you area now able to do more custom actions like copying some files in place or something.
###Gems that are autoloaded
##Vagrant Just to note you can by pass the rake taskes and just use Vagrant on it's own, but you will have to magage your files on your own, and make sure that you edit your configs too. There is a lot to learn under the hood.
###Vagrant plugins that are autoloaded
- User:
root
- Pass:
blank
There are 3 servers that run when mirroring the production servers, or just one if you want a development base. note: This set up is currently a Shell provisioner only. Later when branching, there will be a switch to CentOS and to a new provisioner option. Currently options are Chef and Salt as considered
- Ubuntu 12.04 LTS (Precise Pangolin)
- nginx 1.4.2
- mysql 5.5.32
- php-fpm 5.4.17
- memcached 1.4.13
- PHP memcache extension 3.0.8
- xdebug 2.2.3
- PHPUnit 3.7.24
- ack-grep 2.04
- git 1.8.3.4
- ngrep
- dos2unix
- phpMemcachedAdmin 1.2.2 BETA
Note this is the highlights, for a full list look here
So moving forward, the ruby wrapper is built out to be able to have use for Wordpress (or any other setup) like many of the other vagrant projects, but should it be totally abstracted enough for that? Maybe if there is interest it would be and at which point then there would be a wrapper project on its own and this would be reduced do to only the Magento parts of the environment.
keep it to your self.. no tell it like it is but atm there is no area to yell at except on here.
If you find what looks like a bug:
- Search the [mailing list] COMING SOON
- Check the GitHub issue tracker to see if anyone else has reported issue.
- If you don't see anything, create an issue with information on how to reproduce it.
If you want to contribute an enhancement or a fix: (will be better defined later)
- Fork the project on GitHub.
- Make your changes with tests.
- Commit the changes to your fork.
- Send a pull request.
Original Author: jeremyBass