Skip to content

Commit

Permalink
Merge pull request #10 from pmsipilot/vagrantfile
Browse files Browse the repository at this point in the history
adding Vagrantfile
  • Loading branch information
willgarcia committed Aug 31, 2015
2 parents 993f809 + 5ebc74f commit df50db2
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.vm.box_url = "https://atlas.hashicorp.com/ARTACK/boxes/debian-jessie"
config.vm.box = "ARTACK/debian-jessie"

config.vm.provider "virtualbox" do |vbox,override|
vbox.customize ["modifyvm", :id, "--memory", 1024]
vbox.customize ["modifyvm", :id, "--cpus", 1]
override.vm.synced_folder ".", "/opt/demoinstance", :id => "vagrant-root", owner: "root", group: "root", :mount_options => ["dmode=777", "fmode=777"]
end

config.vm.usable_port_range = (2200..2299)
config.vm.network "forwarded_port", guest: 8080, host: 2280, auto_correct: true
config.vm.network "forwarded_port", guest: 8081, host: 2281, auto_correct: true

config.vm.define :master do |master|
master.vm.provision "shell" do |sh|
sh.path = "ressources/vagrant_setup.sh"
end
end
end
16 changes: 16 additions & 0 deletions ressources/vagrant_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

sudo apt-get install -y nginx python-pip supervisor python-dev libldap2-dev libsasl2-dev libmysqlclient-dev screen nodejs npm
(cd /opt/demoinstance/backend && sudo python setup.py install)
sudo cp /opt/demoinstance/ressources/supervisor_dev/*.conf /etc/supervisor/conf.d/
cp /opt/demoinstance/ressources/dev_demoinstance /opt/demoinstance/dev_demoinstance
cp /opt/demoinstance/ressources/dev_demoinstance.py /opt/demoinstance/dev_demoinstance.py
sudo /etc/init.d/nginx stop
sudo /etc/init.d/supervisor stop
sudo rm -f /var/run/supervisor.sock
sudo rm -f /etc/nginx/sites-enabled/default
sudo cp /opt/demoinstance/ressources/nginx/nginx-server /etc/nginx/sites-enabled/default
sudo cp -R /opt/demoinstance/config /etc/demoinstance
sudo ln -s /usr/bin/nodejs /usr/bin/node
screen -S log -d -m sudo /usr/bin/supervisord -c /etc/supervisor/supervisord.conf

0 comments on commit df50db2

Please sign in to comment.