Skip to content

browsermedia/browsercms-dev-box

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Virtual Machine for BrowserCMS Core Development

Introduction

This project automates the setup of a development environment for working on BrowserCMS projects themselves. Use this virtual machine to work on a pull request with everything ready to hack and run the test suites.

This can also be used for developing on BrowserCMS projects.

Requirements

How To Build The Virtual Machine

Building the virtual machine is this easy:

host $ git clone https://github.com/browsermedia/browsercms-dev-box
host $ cd browsercms-dev-box
host $ vagrant up

That's it.

If the base box is not present that command fetches it first. The setup itself takes about 3 minutes in my MacBook Air. After the installation has finished, you can access the virtual machine with

host $ vagrant ssh
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)
...
vagrant@browsercms-dev-box:~$

Port 3000 in the host computer is forwarded to port 3000 in the virtual machine. Thus, applications running in the virtual machine can be accessed via localhost:3000 in the host computer.

What's In The Box

  • Git

  • RVM

  • Ruby 2.0.0 (binary RVM install)

  • Bundler

  • SQLite3, MySQL, and Postgres

  • System dependencies for nokogiri, sqlite3, mysql, mysql2, and pg

  • Databases and users needed to run the Active Record test suite

  • Node.js for the asset pipeline

  • Memcached

Recommended Workflow

The recommended workflow is

  • edit in the host computer and

  • test within the virtual machine.

Just clone your Rails fork into the browsercms-dev-box directory on the host computer:

host $ ls
README.md   Vagrantfile puppet
host $ git clone git@github.com:<your username>/browsercms.git

Vagrant mounts that directory as /vagrant within the virtual machine:

vagrant@browsercms-dev-box:~$ ls /vagrant
puppet  browsercms  README.md  Vagrantfile

Install gem dependencies in there:

vagrant@browsercms-dev-box:~$ cd /vagrant/browsercms
vagrant@browsercms-dev-box:/vagrant/browsercms$ bundle

We are ready to go to edit in the host, and test in the virtual machine.

This workflow is convenient because in the host computer you normally have your editor of choice fine-tuned, Git configured, and SSH keys in place.

Virtual Machine Management

When done just log out with ^D and suspend the virtual machine

host $ vagrant suspend

then, resume to hack again

host $ vagrant resume

Run

host $ vagrant halt

to shutdown the virtual machine, and

host $ vagrant up

to boot it again.

You can find out the state of a virtual machine anytime by invoking

host $ vagrant status

Finally, to completely wipe the virtual machine from the disk destroying all its contents:

host $ vagrant destroy # DANGER: all is gone

Please check the Vagrant documentation for more information on Vagrant.

License

Released under the MIT License, Copyright (c) 2012–ω Xavier Noria.

About

A virtual machine for Ruby on Rails core development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Perl 52.0%
  • Puppet 29.3%
  • Ruby 18.7%