-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented new developer environment for the symfony-cmf
- vagrant with an ubuntu trusty - stack with customizable parameters (hostname/ip/php version) - support for the jackrabbit and doctrine-dbal implementations of jackalope
- Loading branch information
Showing
26 changed files
with
565 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
require 'yaml' | ||
|
||
Vagrant.configure(2) do |cmf| | ||
config = get_validated_vm_config | ||
|
||
# Basic box settings | ||
cmf.vm.box = "ubuntu/trusty64" | ||
cmf.vm.hostname = config['hostname'] | ||
|
||
cmf.vm.synced_folder ".", "/var/www/cmf", :nfs => true | ||
|
||
# Custom virtualbox settings | ||
cmf.vm.provider "virtualbox" do |vb| | ||
# vb settings | ||
vb.name = config['name'] | ||
|
||
# vb customizations | ||
vb.customize ['modifyvm', :id, '--cpus', config['cpus']] | ||
vb.customize ['modifyvm', :id, '--memory', config['memory']] | ||
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] | ||
end | ||
|
||
# Private network | ||
cmf.vm.network :private_network, :ip => config['ip'] | ||
|
||
# Provisioners: | ||
# 1.: installs all mandatory puppet modules | ||
# 2.: setup of the machine (php, apache vhost, mysql/jackrabbit, parameter files) | ||
# 3.: setup of the application (phpcr setup using app/console commands) | ||
cmf.vm.provision :shell, path: "vagrant/puppet.sh" | ||
cmf.vm.provision :puppet do |puppet| | ||
puppet.manifests_path = "vagrant/manifests" | ||
puppet.module_path = ['vagrant/puppet'] | ||
puppet.manifest_file = 'site.pp' | ||
puppet.options = ["--verbose"] | ||
puppet.hiera_config_path = 'vagrant/hiera.yaml' | ||
end | ||
|
||
cmf.vm.provision :shell, path: "vagrant/composer.sh" | ||
end | ||
|
||
def get_validated_vm_config() | ||
filename = 'vagrant/machine.yaml' | ||
|
||
unless File.exists?(filename) | ||
abort "File #{filename} does not exist!" | ||
end | ||
|
||
config = YAML::load(File.open(filename)) | ||
unless config | ||
config = {} | ||
end | ||
|
||
if File.exists?('vagrant/local_machine.yaml') | ||
config = config.merge(YAML::load(File.open('vagrant/local_machine.yaml'))) | ||
end | ||
|
||
if config['ip'].nil? | ||
abort "The configuration parameter 'ip' is necessary!" | ||
end | ||
|
||
if config['cpus'].nil? | ||
config['cpus'] = 1 | ||
end | ||
|
||
if config['memory'].nil? | ||
config['memory'] = 1024 | ||
end | ||
|
||
if config['name'].nil? | ||
config['name'] = 'Symfony-CMF VM' | ||
end | ||
|
||
if config['hostname'].nil? | ||
config['hostname'] = 'symfony-cmf' | ||
end | ||
|
||
return config | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
cd $(dirname $0) | ||
|
||
VERSION=2.6.0 | ||
VERSION=2.6.5 | ||
JAR=jackrabbit-standalone-$VERSION.jar | ||
|
||
# one per line | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
exec_cmf_command() { | ||
su -l vagrant -c "(cd /var/www/cmf && $1)" | ||
} | ||
|
||
init_mysql() { | ||
exec_cmf_command "php app/console doctrine:database:create" | ||
exec_cmf_command "php app/console doctrine:phpcr:init:dbal" | ||
} | ||
|
||
init_jackrabbit() { | ||
exec_cmf_command "./jack start" | ||
} | ||
|
||
main() { | ||
storage_type=`cat /etc/storage_type.txt` | ||
|
||
exec_cmf_command "composer install" | ||
|
||
if [ $storage_type = 'mysql' ]; then | ||
init_mysql | ||
else | ||
init_jackrabbit | ||
fi | ||
|
||
exec_cmf_command "php app/console doctrine:phpcr:workspace:create default" | ||
exec_cmf_command "php app/console doctrine:phpcr:repository:init" | ||
exec_cmf_command "php app/console -v doctrine:phpcr:fixtures:load --no-interaction" | ||
exec_cmf_command "php app/console assetic:dump" | ||
|
||
export $storage_type | ||
} | ||
|
||
main |
Oops, something went wrong.