-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added vagrant config to automate env setup and unit testing
- Loading branch information
Phillip Shipley
committed
Oct 9, 2013
1 parent
9ad25d0
commit fec66de
Showing
3 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ nbproject/ | |
vendor/ | ||
*.local.php | ||
build/ | ||
.vagrant/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# 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| | ||
# All Vagrant configuration is done here. The most common configuration | ||
# options are documented and commented below. For a complete reference, | ||
# please see the online documentation at vagrantup.com. | ||
|
||
# Every Vagrant virtual environment requires a box to build off of. | ||
config.vm.box = "ubuntuserver12.04x86_64" | ||
|
||
# The url from where the 'config.vm.box' box will be fetched if it | ||
# doesn't already exist on the user's system. | ||
config.vm.box_url = "http://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-vagrant-amd64-disk1.box" | ||
|
||
# System setup/configuration | ||
config.vm.provision :shell, :path => "vagrant-setup.sh" | ||
|
||
# Give it some more memory | ||
config.vm.provider "virtualbox" do |v| | ||
v.customize ["modifyvm", :id, "--memory","768"] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# Install necessary packages | ||
sudo add-apt-repository -y ppa:chris-lea/node.js | ||
sudo apt-get update -y | ||
sudo apt-get install -y git python-software-properties build-essential libxml2-dev nodejs redis-server php5 php5-curl | ||
sudo npm install -g apiaxle-repl apiaxle-proxy apiaxle-api | ||
|
||
# Start ApiAxle processes | ||
apiaxle-proxy -p 3000 & | ||
sleep 3 | ||
apiaxle-api -p 8000 & | ||
sleep 3 | ||
|
||
# Create non-shared folder for running tests | ||
sudo mkdir /apiaxle | ||
sudo cp -R /vagrant/* /apiaxle/ | ||
sudo chown -R vagrant:vagrant /apiaxle | ||
|
||
# Reuse travis configuration to provision apiaxle api and key | ||
cd /apiaxle | ||
./travis.setup.sh | ||
|
||
# Update composer dependencies | ||
cd /apiaxle | ||
php composer.phar self-update | ||
php composer.phar update | ||
|
||
# Run unit tests | ||
cd /apiaxle | ||
./vendor/bin/phpunit tests/ |