Git Product home page Git Product logo

vagrant-yeoman-env's Introduction

vagrant-yeoman-env

A vagrant dev environment for yeoman (http://yeoman.io) that uses a Ubuntu 12.10 Server image and Puppet for provisioning.

This repo is intended as a proof of concept for creating and running a fully-functional Yeoman default scaffolding ("generator-webapp") project in Vagrant.

Dependencies

  1. Vagrant
  2. VirtualBox (for local servers)

Usage

To create your local Yeoman environment:

    $ git clone https://github.com/lwndev/vagrant-yeoman-env.git
    $ cd vagrant-yeoman-env/vagrant
    $ vagrant up

This will do the following

  1. Download a Vagrant 'base box' for VirtualBox. The box in question includes Ubuntu Server 12.10 with Ruby 1.9.3p194 and Puppet 2.7.18.
  2. Boot the VM and run Puppet to install additional dependencies:
    1. vim
    2. bash
    3. nodejs
    4. git
    5. fontconfig
  3. Then a few gems are installed:
    1. Compass
    2. SASS
  4. Then some additional dependencies for Yeoman are installed via NPM
    1. Yo
    2. Grunt
    3. Bower
    4. Phantomjs
    5. Yeoman "webapp" generator
  5. Then yo is called with the webapp generator as its argument and a project skeleton is created
  6. And finally, once the webapp project is in place a small tweak is made to Gruntfile.js in the /webapp directory that makes the webapp instance available to the host machine when it is running

This entire process will take about 10-15 minutes on a high-speed connection (20MBS+). The base box is about 430MB and there's around 300MB of dependencies that need to be downloaded once the VM boots.

All of the files and directories generated by the webapp scaffolding are available in the "webapp" directory of the folder created when this repo is cloned.

Viewing the project

Once everything is downloaded and puppet is done running, you can log in to the VM and start the server

    $ vagrant ssh
    $ cd ~/yeoman/webapp
    $ grunt server

Then you can access the server on your host machine's browsers at http://192.168.40.10:9000

Testing

If you want to run unit tests on the project, ssh to the box, cd to ~/yeoman/webapp and run the following command

    $ grunt test

This will run your unit tests using the headless Webkit browser "Phantomjs"

Packaging

If you want to package your project, ssh to the box, cd to ~/yeoman/webapp and run the following command

    $ grunt

Compressed, packaged assets can be found in ~/yeoman/webapp/dist

Notes

  • The VM uses 1GB of RAM. This is probably overkill and you can adjust memory allocation in the Vagrantfile if you wish (/vagrant/Vagrantfile)
  • Live refresh of the browser is not currently supported as the project server and your browser are running on different operating systems.

Happy Coding!

vagrant-yeoman-env's People

Contributors

lwndev avatar

Watchers

James Cloos avatar Lee McKay avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.