forked from impactdialing/impactdialing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
72 lines (61 loc) · 2.48 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
VAGRANTFILE_API_VERSION = "2"
$script1 = <<SCRIPT1
echo provisioning...
echo system update...
sudo apt update
sudo apt upgrade -s
sudo apt install libxml2 libxml2-dev libxslt1.1 libxslt1-dev libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x redis-server git -y
sudo apt install qt5base-dev qtdeclarative5-dev qt5-qmake qt5-default qttools5-dev-tools qt5-default qtchooser -y
sudo apt-get install qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x -y
export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get -q -y install mysql-server mysql-client libmysqlclient-dev -y
SCRIPT1
# mysqladmin -u root password MYSQLPASS
$script2 = <<SCRIPT2
echo getting the keys for rvm...
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s $1
SCRIPT2
$script3 = <<SCRIPT3
echo installing rvm and ruby...
# source /etc/profile.d/rvm.sh
source $HOME/.rvm/scripts/rvm
rvm use --default --install $1 --quiet-curl
gem install bundler
rvm cleanup all
SCRIPT3
$script4 = <<SCRIPT4
echo doing the bundle install...
source $HOME/.rvm/scripts/rvm
cd /vagrant
rvm use
bundle install
echo setting up the databases...
bundle exec rake db:create RAILS_ENV=test
bundle exec rake db:schema:load RAILS_ENV=test
bundle exec rake db:create RAILS_ENV=development
bundle exec rake db:schema:load RAILS_ENV=development
echo ******* DONE!!! If all went ok, you might have a server available at http://localhost:3001/
echo start the rails server...
bundle exec rails server
SCRIPT4
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# add memory...
config.vm.provider "virtualbox" do |v|
v.memory = 2048
end
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", type: "dhcp"
config.vm.network "forwarded_port", guest: 3000, host: 3001
config.vm.provision :shell, inline: $script1, privileged: false
config.vm.provision :shell, inline: $script2, args: "stable", privileged: false
config.vm.provision :shell, inline: $script3, args: "2.2.4", privileged: false
config.vm.provision :shell, inline: $script4, privileged: false
end
# sudo su vagrant
# echo user should be vagrant...
# gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
# curl -sSL https://get.rvm.io | bash -s stable
# source /home/vagrant/.rvm/scripts/rvm
# rvm install "ruby-2.2.4"
# gem install bundler