Skip to content

Commit

Permalink
Added Vagrant
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Kliment committed Oct 25, 2013
1 parent e22c4b0 commit ec66075
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
/lib
/lib
.vagrant
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
src/
.git*

.vagrant
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,47 @@ See [dredd-example](https://github.com/apiaryio/dredd-example) repo for real-lif
## API Blueprint testability
Dredd can test only API resources specified by *well defined transaction*. Any Non specific resources in the Blueprint e. g. with URI template or query parameters without default or example values are considered as *ambiguous transaction* thus they are resulting in a *warning* during the test run and are skipped.


## Virtual development environment

It's recomended to use [Vagrant][] with [VirtualBox][] in order to achieve consistent development environment across all contributors.

### Installation

- Download and install latest [VirtualBox][]
- Download and install latest [Vagrant][]
- Clone GitHub repo:
```
$ git clone git@github.com:apiaryio/dredd.git
$ cd dredd
```
- Import the vagrant box:
```
$ vagrant box add precise64 http://files.vagrantup.com/precise64.box
```
- Start virtual development environment:
```
$ vagrant up
```
- SSH to the virtual development environment:
```
$ vagrant ssh
```
- You will find your project shared in `/vagrant` inside the virtual envinronment
```
$ cd /vagrant
```
- Use your favorite local editor in your local folder to edit the code and run tests in the virtual environment
```
$ npm install && npm test
```



[API Blueprint]: http://apiblueprint.org/
[Travis CI]: https://travis-ci.org/
[Jenkins]: http://jenkins-ci.org/
[Gavel]: http://blog.apiary.io/2013/07/24/Bam-this-is-Gavel/
[behavior specification]: https://www.relishapp.com/apiary/gavel/docs

[Vagrant]: http://www.vagrantup.com/
[VirtualBox]: https://www.virtualbox.org/
14 changes: 14 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"

config.vm.provision "shell", path: "provisioning.sh"

config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
end

config.vm.synced_folder ".", "/vagrant", nfs: true
end
6 changes: 6 additions & 0 deletions provisioning.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
sudo apt-get install -y mc curl git-core build-essential
sudo su vagrant -c 'curl https://raw.github.com/creationix/nvm/master/install.sh | sh'
sudo su vagrant -c '. ~vagrant/.nvm/nvm.sh; nvm install v0.10.21'
sudo su vagrant -c '. ~vagrant/.nvm/nvm.sh;nvm use v0.10.21'
sudo su vagrant -c '. ~vagrant/.nvm/nvm.sh;nvm alias default v0.10.21'

0 comments on commit ec66075

Please sign in to comment.