Skip to content

Commit

Permalink
Brand new vagrant configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Sep 26, 2013
1 parent fe79729 commit 7b9d959
Show file tree
Hide file tree
Showing 19 changed files with 280 additions and 147 deletions.
27 changes: 27 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[submodule "vagrant/modules/stdlib"]
path = vagrant/modules/stdlib
url = [email protected]:puppetlabs/puppetlabs-stdlib.git
[submodule "vagrant/modules/puppi"]
path = vagrant/modules/puppi
url = [email protected]:example42/puppi.git
[submodule "vagrant/modules/apache"]
path = vagrant/modules/apache
url = [email protected]:example42/puppet-apache.git
[submodule "vagrant/modules/apt"]
path = vagrant/modules/apt
url = [email protected]:puppetlabs/puppetlabs-apt.git
[submodule "vagrant/modules/composer"]
path = vagrant/modules/composer
url = [email protected]:vagrantee/puppet-composer.git
[submodule "vagrant/modules/mysql"]
path = vagrant/modules/mysql
url = [email protected]:puppetlabs/puppetlabs-mysql.git
[submodule "vagrant/modules/php"]
path = vagrant/modules/php
url = [email protected]:example42/puppet-php.git
[submodule "vagrant/modules/puphpet"]
path = vagrant/modules/puphpet
url = [email protected]:puphpet/puppet-puphpet.git
[submodule "vagrant/modules/xdebug"]
path = vagrant/modules/xdebug
url = [email protected]:puphpet/puphpet-xdebug.git
18 changes: 18 additions & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,22 @@ public function registerContainerConfiguration(LoaderInterface $loader)
$loader->load($file);
}
}

public function getCacheDir()
{
if (in_array($this->environment, array('dev', 'test')) && is_dir('/dev/shm')) {
return '/dev/shm/sylius/cache/' . $this->environment;
}

return parent::getCacheDir();
}

public function getLogDir()
{
if (in_array($this->environment, array('dev', 'test')) && is_dir('/dev/shm')) {
return '/dev/shm/sylius/logs';
}

return parent::getLogDir();
}
}
10 changes: 10 additions & 0 deletions app/SymfonyRequirements.php
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,14 @@ function_exists('simplexml_import_dom'),
'Install PHP 5.4.11 or newer if your project uses the logout handler from the Symfony Security Component.'
);

$this->addRecommendation(
(version_compare($installedPhpVersion, '5.3.18', '>=') && version_compare($installedPhpVersion, '5.4.0', '<'))
||
version_compare($installedPhpVersion, '5.4.8', '>='),
'You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909',
'Install PHP 5.3.18+ or PHP 5.4.8+ if you want nice error messages for all fatal errors in the development environment.'
);

if (null !== $pcreVersion) {
$this->addRecommendation(
$pcreVersion >= 8.0,
Expand Down Expand Up @@ -640,6 +648,8 @@ class_exists('Locale'),
||
(extension_loaded('apc') && ini_get('apc.enabled'))
||
(extension_loaded('Zend Optimizer+') && ini_get('zend_optimizerplus.enable'))
||
(extension_loaded('Zend OPcache') && ini_get('opcache.enable'))
||
(extension_loaded('xcache') && ini_get('xcache.cacher'))
Expand Down
1 change: 1 addition & 0 deletions vagrant/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.vagrant/
47 changes: 27 additions & 20 deletions vagrant/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
# Getting started using Vagrant
# Description
This configuration includes following software:

## You will need:
* PHP 5.4.19
* MySQL 5.5.32
* GIT 1.7.9.5
* Apache 2.2.22
* Vim
* MC (Midnight commander)
* Curl
* Xdebug
* Composer

* Git 1.6+
* NFS (MacOS works OOB, on Debian based linux distributions install **nfs-kernel-server** package)
* [Vagrant](http://vagrantup.com)
# Usage

## Get the code
First you need to install git submodules. Go to your project root folder and execute following commands:
```
$ git submodule init
$ git submodule update
```

git clone git://github.com/Sylius/Sylius.git
cd Sylius/vagrant
vagrant up
Now you are ready to run

Now everything is getting prepared.
In the meantime you can optionally add an entry to your `/etc/hosts` file like so:
```
$ cd vagrant
$ vagrant up
```

172.33.33.33 sylius.local
While waiting for the vagrant to stand up you should add an entry into /etc/hosts file at host machine.

## Access by web browser
```
10.0.0.200 sylius.dev
```

If you have added the entry to `/etc/hosts` you should be able to access the Sylius like this:

<http://sylius.local/dev.php>

Otherwise you can also use the IP address:

<http://172.33.33.33/dev.php>
From now you should be able to access your sylius project at host machine under http://sylius.dev/ address.
44 changes: 17 additions & 27 deletions vagrant/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"

Vagrant::Config.run 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.
config.vm.network :private_network, ip: "10.0.0.200"
config.ssh.forward_agent = true

# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise32"
config.vm.host_name = "sylius"

# 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://files.vagrantup.com/precise32.box"

config.vm.network :hostonly, "172.33.33.33"
config.vm.share_folder "v-root", "/mnt/sylius", ".." , :nfs => true

# Whithout this symlinks can't be created on the shared folder.
config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 1024]
v.customize ["modifyvm", :id, "--name", "sylius"]
end

# Chef solo configuration.
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "./"
# Chef debug level, start vagrant like this to debug:
# $ CHEF_LOG_LEVEL=debug vagrant <provision or up>
chef.log_level = ENV['CHEF_LOG'] || "info"
nfs_setting = RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/
config.vm.synced_folder "./../", "/var/www/sylius", id: "vagrant-root" , :nfs => nfs_setting
config.vm.provision :shell, :inline => "sudo apt-get update"

# Chef recipes.
chef.add_recipe("cookbook")
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "manifests"
puppet.module_path = "modules"
puppet.options = ['--verbose']
end
end
89 changes: 0 additions & 89 deletions vagrant/cookbook/recipes/default.rb

This file was deleted.

11 changes: 0 additions & 11 deletions vagrant/cookbook/templates/default/vhost.conf.erb

This file was deleted.

Loading

0 comments on commit 7b9d959

Please sign in to comment.