Commit f2b8ce05a731c8e1f4d541d5af87f19422469dc8
1 parent
014ec9dc
Exists in
master
and in
4 other branches
inclusão do arquivo vagrant para reload sem port forward
Showing
1 changed file
with
53 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,53 @@ | @@ -0,0 +1,53 @@ | ||
1 | +# -*- mode: ruby -*- | ||
2 | +# vi: set ft=ruby : | ||
3 | + | ||
4 | +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | ||
5 | +VAGRANTFILE_API_VERSION = "2" | ||
6 | + | ||
7 | +$firstTimeScript = <<SCRIPT | ||
8 | + | ||
9 | +cd /vagrant && composer update && rm -r /var/www/public && ln -s /vagrant/src /var/www/public | ||
10 | + | ||
11 | +cp /vagrant/config/wp-config-vagrant.php /vagrant/src/wp-config.php | ||
12 | +cp /vagrant/config/htaccess-vagrant /vagrant/src/.htaccess | ||
13 | + | ||
14 | +service apache2 start | ||
15 | + | ||
16 | +service mysql start | ||
17 | + | ||
18 | +mysql --user=root --password=root -h 127.0.0.1 -e 'drop database participacao' | ||
19 | +mysql --user=root --password=root -h 127.0.0.1 -e 'create database participacao' | ||
20 | +mysql --user=root --password=root -h 127.0.0.1 participacao < /vagrant/db/db.sql | ||
21 | + | ||
22 | +SCRIPT | ||
23 | + | ||
24 | +$updateServices = <<SCRIPT | ||
25 | + | ||
26 | +service mysql start | ||
27 | + | ||
28 | +rm -r /var/www/public | ||
29 | +ln -s /vagrant/src/ /var/www/public | ||
30 | +chmod 777 /vagrant/src/wp-content/ | ||
31 | + | ||
32 | +service apache2 start | ||
33 | + | ||
34 | +SCRIPT | ||
35 | + | ||
36 | +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
37 | + | ||
38 | + # Every Vagrant virtual environment requires a box to build off of. | ||
39 | + config.vm.box = "scotch/box" | ||
40 | + config.vm.network "forwarded_port", guest: 80, host: 80 | ||
41 | + config.vm.network "forwarded_port", guest: 80, host: 8080 | ||
42 | + # Port de debug do xdebug | ||
43 | + config.vm.network "forwarded_port", guest: 9000, host: 9000 | ||
44 | + | ||
45 | + config.vm.provision "shell", inline: $firstTimeScript | ||
46 | + | ||
47 | + config.vm.provision "shell", inline: $updateServices, | ||
48 | + run: "always" | ||
49 | + | ||
50 | +end | ||
51 | + | ||
52 | + | ||
53 | + |