Shop in the box

My last post described the first part of my new development environment, the vagrant basebox. The box will be provisioned with puppet, a collection of manifests can be found at github. In the ARCHIVE directory of this repository there’s a collection of VM example configurations.The manifests contain all I currently need for my pet projects and the collection will grow and change as time progresses.

The vagrant VM as today uses

  • Vagrant 1.7.2
  • Puppet 3.7.3
  • Hiera, a key/value lookup tool for configuration data. Hiera is included in Puppet 3.
  • VirtualBox 4.3.20
  • The base box is a slightly modified version of hashicorp/precise32 (Ubuntu 12.04 LTS), for more information click here.
  • vagrant-vbguest (0.10.0)
  • vagrant-hostmanager (1.5.0)

Projects are organized as follows:
Each project has one (or more) directories with the projectcode and a directory vmconfig containing the virtual machine configuration.

vmconfig explained

The Vagrantfile describes how to configure and provision the virtual machine for the current project. Directory .vagrant is created by Vagrant. The hiera.yaml file is to be found in a directory named config. Lookup hierarchy is common (e.g. spanning several projects) -> project specific -> private (e.g. developer’s own) for development and production, related yaml files are located in directory environments. Also in directory environments lives a file named site.pp specifing which puppet modules are needed for the current project vm. As I keep the puppet modules in a github repository separated from possible projects, the puppet modules directory inside project’s vmconfig directory is always a link to the actual puppet modules directory.

Getting a project on a virtual machine up and running is dead easy (well, ok, at least locally and for me it works just fine ;) ).

For convenience and as I have plans to play around with it soonish, let’s install an OXID eShop Community Edition (CE) as project. The puppet manifest named oxideshopce downloads the newest official CE relase package from OXID and unzips it into my chosen target directory. I’ve no script for an automatic shop setup yet, so after the vm is up and running, you still need to manually click through the shop setup steps at the moment.

Six steps to get the project prepared:

  1. Create a directory MYPROJECT.
  2. Inside MYPROJECT directory create a directory theproject. This folder will be synched to the vm.
  3. Inside MYPROJECT directory do git clone https://github.com/hkreuter/deve2015.git
  4. Copy the oxshop stuff from deve2015/ARCHIVE to MYPROJECT/theproject/vmconfig.
  5. Inside MYPROJECT/theproject/vmconfig create a link to deve2015/modules: ln -s ../../deve2015/modules/ modules
  6. Inside directory MYPROJECT/vmconfig run vagrant up

the project

If all works as desired, the virtual machine is ready and provisioned after the first vagrant/puppet run.

the shopThe Vagrant hostmanager (see new vagrant basebox post) takes care of updating the host machine’s /etc/hosts file. After the box is up, the shop can be accessed at http://oxpl, the phpMyAdmin http://oxpl/phpmyadmin (login/pwd is root/root).

This entry was posted in howto, oxshop, tools and tagged , , , . Bookmark the permalink.

Comments are closed.