paf31/purescript-vagrant — pull request #2 by jdantonio (2014-08-17 19:43:34+00:00)
Title: Shell provision PureScript and all dependencies.

TL;DR This PR adds a second Vagrant config that uses shell scripts for provisioning. The shell scripts aren't entirely idempotent the way Chef/Puppet/Ansible/etc. try to be, but they are more cross-platform portable. This new configuration has been tested on multiple hosts: Mac OS X, Windows 7, Ubuntu 14.04, and works consistently on all three.

===================

I recently purchased your book through Leanpub and began working through the [code samples/exercises](https://github.com/jdantonio/purescript-exercises). I saw this Vagrant project and thought I might offer a hand. This is a *significant* departure from the original approach, so I will completely understand if it isn't the direction you want to go. If you like this new approach I'd be happy to remove the original config, make additional changes, update the README, etc.

The goal of this PR is to allow this project to be used on multiple host operating systems. By using simple shell scripts there are no dependencies other than Vagrant and VirtualBox (unlike the original which requires Berkshelf and a ton of extra gems). It should work on *any* host that can run Vagrant, and it should work with VM providers other than VirtualBox as well (although that hasn't been tested).

The original Berkshelf-based config is the "primary" config and works the same way it did before. To test/use the new config, the config name "with-shell" must be appended to *all* command:

```shell
vagrant up with-shell
vagrant ssh with-shell
vagrant halt with-shell
```

The new config uses Ubuntu 14.04 and performs the following tasks:

* Updates the OS with all the latest packages
* Removes some unnecessary DevOps stuff (puppet, chef)
* Installs Ubuntu's build-essentials
* Installs basic development tools (like git, vim, emacs, etc.)
* Installs Haskell using apt
* Updates and configures Cabal
* Adds the Cabal bin directory to the vagrant user's path
* Installs Node from the chris-lea PPA
* Installs other JS dependencies (grunt, grunt-cli, bower) as the vagrant user
* Installs PureScript from Cabal
* Attempts to copy the user's ssh keys to the VM (quicker access to GitHub)

I've tested this on three operating system (hosts):

* Windows 7 Professional
* Mac OS X
* Ubuntu 14.04

In each case I was immediately able to ssh into the VM and perform several actions:

* Run `psci` from any directory
* Clone my PureScript [test repo](https://github.com/jdantonio/purescript-exercises)
* `cd` into my `ch2` and `ch3` directories and successfully run the following commands:
* `npm install`
* `bower install`
* `grunt`
* `psci`

As far as I can tell, the new config includes everything necessary to immediately begin PureScript development once the VM is provisioned (although that process take several minutes). Please give it a try and let me know if it works for you and--more importantly--if it achieves the intended goals of this Vagrant project.