forked from pensandoodireito/participacao-sitebase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile-no-port-forward
59 lines (38 loc) · 1.49 KB
/
Vagrantfile-no-port-forward
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$firstTimeScript = <<SCRIPT
cd /vagrant && composer update && rm -r /var/www/public && ln -s /vagrant/src /var/www/public
cp /vagrant/config/wp-config-vagrant.php /vagrant/src/wp-config.php
cp /vagrant/config/htaccess-vagrant /vagrant/src/.htaccess
service apache2 start
service mysql start
mysql --user=root --password=root -h 127.0.0.1 -e 'drop database participacao'
mysql --user=root --password=root -h 127.0.0.1 -e 'create database participacao'
cd /vagrant/db
bunzip2 db.sql.bz2
mysql --user=root --password=root -h 127.0.0.1 participacao < /vagrant/db/db.sql
bzip2 -9 db.sql
SCRIPT
$updateServices = <<SCRIPT
service mysql start
rm -r /var/www/public
ln -s /vagrant/src/ /var/www/public
chmod 777 /vagrant/src/wp-content/
service apache2 start
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "scotch/box"
config.vm.network "forwarded_port", guest: 80, host: 80
config.vm.network "forwarded_port", guest: 80, host: 8080
# Port de debug do xdebug
config.vm.network "forwarded_port", guest: 9000, host: 9000
config.vm.provision "shell", inline: $firstTimeScript
config.vm.provision "shell", inline: $updateServices,
run: "always"
#config.vm.provider :virtualbox do |vb|
# vb.gui = true
#end
end