diff --git a/.gitignore b/.gitignore index d091a67b..9dbc54c7 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,3 @@ /app/config/phpcr.yml /app/app.sqlite -/jackrabbit/ -/jackrabbit-standalone-*.jar -/vagrant/.vagrant diff --git a/.sensiolabs.yml b/.sensiolabs.yml index 382c4653..bbf3141d 100644 --- a/.sensiolabs.yml +++ b/.sensiolabs.yml @@ -7,7 +7,6 @@ global_exclude_dirs: - vendor - web - app/tests - - vagrant - bin pre_composer_script: | diff --git a/README.md b/README.md index ed45cc90..035b2815 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ Link to the [live demo](http://sandbox.cmf.symfony.com/) ## Getting started -You can run the sandbox on your system, or in a virtualbox VM using Vagrant. For the latter, see -"Getting started using Vagrant" +You can run the sandbox on your system if you have Apache or Nginx installed or +[use Homestead](https://symfony.com/doc/current/setup/homestead). ### You will need: @@ -140,10 +140,6 @@ you need to generate the doctrine proxies and dump the assetic assets: php app/console cache:warmup --env=prod --no-debug php app/console assetic:dump --env=prod --no-debug -# Getting started using Vagrant - -please checkout the [README.md](vagrant) in the vagrant/ folder of the project - # Other hints ## Console diff --git a/vagrant/README.md b/vagrant/README.md deleted file mode 100644 index 0b0e7008..00000000 --- a/vagrant/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# Getting started using Vagrant - -## You will need: - * Git 1.6+ - * NFS (MacOS works OOB, on Debian based linux distributions install nfs-kernel-server package) - * [Vagrant](http://vagrantup.com) - -## Get the code - - git clone git://github.com/symfony-cmf/cmf-sandbox.git - cd cmf-sandbox/vagrant - vagrant up - -Now everything is getting prepared. -In the meantime you can optionally add an entry to your `/etc/hosts` file like so: - - 172.22.22.22 cmf.lo - -## Access by web browser - -If you have added the entry to `/etc/hosts` you should be able to access the Sandbox like this: - - - -Otherwise you can also use the IP address: - - - - diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile deleted file mode 100644 index 995743a0..00000000 --- a/vagrant/Vagrantfile +++ /dev/null @@ -1,41 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -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. - - # Every Vagrant virtual environment requires a box to build off of. - config.vm.box = "precise32" - config.vm.host_name = "cmfsandbox" - config.vm.customize ["modifyvm", :id, "--memory", 768] - - # 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" - - # Boot with a GUI so you can see the screen. (Default is headless) - # config.vm.boot_mode = :gui - - config.vm.network :hostonly, "172.22.22.22" - config.vm.share_folder "v-root", "/vagrant", ".." , :nfs => true - # without this symlinks can't be created on the shared folder - config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"] - - - # create jackrabbit folder in repo and uncomment line if you want to keep your - # repository outside the vm - # config.vm.share_folder "jackrabbit", "/opt/jackrabbit/repository", "../jackrabbit" - - # 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 - chef.log_level = ENV['CHEF_LOG'] || "info" - - # chef recipes - chef.add_recipe("cookbook") - end -end diff --git a/vagrant/cookbook/recipes/default.rb b/vagrant/cookbook/recipes/default.rb deleted file mode 100644 index 9a2f6ab9..00000000 --- a/vagrant/cookbook/recipes/default.rb +++ /dev/null @@ -1,125 +0,0 @@ -# Run apt-get update to create the stamp file -execute "apt-get-update" do - command "apt-get update" - ignore_failure true - not_if do ::File.exists?('/var/lib/apt/periodic/update-success-stamp') end -end - -# For other recipes to call to force an update -execute "apt-get update" do - command "apt-get update" - ignore_failure true - action :nothing -end - -# provides /var/lib/apt/periodic/update-success-stamp on apt-get update -package "update-notifier-common" do - notifies :run, resources(:execute => "apt-get-update"), :immediately -end - -execute "apt-get-update-periodic" do - command "apt-get update" - ignore_failure true - only_if do - File.exists?('/var/lib/apt/periodic/update-success-stamp') && - File.mtime('/var/lib/apt/periodic/update-success-stamp') < Time.now - 86400 - end -end - -# install the software we need -%w( -openjdk-6-jre-headless -curl -tmux -vim -emacs23-nox -git -libapache2-mod-php5 -php5-cli -php5-curl -php5-gd -php5-sqlite -php5-intl -php-apc -).each { | pkg | package pkg } - - -template "/etc/apache2/sites-enabled/vhost.conf" do - user "root" - mode "0644" - source "vhost.conf.erb" - notifies :reload, "service[apache2]" -end - -service "apache2" do - supports :restart => true, :reload => true, :status => true - action [ :enable, :start ] -end - -directory "/opt/jackrabbit" do - owner "root" - group "root" -end - -remote_file "/opt/jackrabbit/jackrabbit.jar" do - source "http://archive.apache.org/dist/jackrabbit/2.4.3/jackrabbit-standalone-2.4.3.jar" - mode "0644" - checksum "e65d2677a9514cf9f8cd216d6a331c2253fd37a2e8daab9a6ca928d602aa83b7" -end - -template "/etc/init.d/jackrabbit" do - mode "0755" - source "jackrabbit.erb" -end - -service "jackrabbit" do - action :start -end - -{ "/vagrant/app/config/parameters.yml.dist" => "/vagrant/app/config/parameters.yml", - "/vagrant/app/config/phpcr_jackrabbit.yml.dist" => "/vagrant/app/config/phpcr.yml" }.each do | src, dest | - file dest do - content IO.read(src) - end -end - -execute "check if short_open_tag is Off in /etc/php5/apache2/php.ini?" do - user "root" - not_if "grep 'short_open_tag = Off' /etc/php5/apache2/php.ini" - command "sed -i 's/short_open_tag = On/short_open_tag = Off/g' /etc/php5/apache2/php.ini" -end - -execute "check if short_open_tag is Off in /etc/php5/cli/php.ini?" do - user "root" - not_if "grep 'short_open_tag = Off' /etc/php5/cli/php.ini" - command "sed -i 's/short_open_tag = On/short_open_tag = Off/g' /etc/php5/cli/php.ini" -end - -execute "check if date.timezone is Europe/Paris in /etc/php5/apache2/php.ini?" do - user "root" - not_if "grep '^date.timezone = Europe/Paris' /etc/php5/apache2/php.ini" - command "sed -i 's/;date.timezone =.*/date.timezone = Europe\\/Paris/g' /etc/php5/apache2/php.ini" -end - -execute "check if date.timezone is Europe/Paris in /etc/php5/cli/php.ini?" do - user "root" - not_if "grep '^date.timezone = Europe/Paris' /etc/php5/cli/php.ini" - command "sed -i 's/;date.timezone =.*/date.timezone = Europe\\/Paris/g' /etc/php5/cli/php.ini" -end - -bash "Running composer install and preparing the phpcr repository" do - not_if "test -e /vagrant/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/public" - user "vagrant" - cwd "/vagrant" - code <<-EOH - set -e - ln -sf /var/tmp/vendor - curl -s https://getcomposer.org/installer | php - COMPOSER_VENDOR_DIR="/var/tmp/vendor" php composer.phar install - echo "Waiting for Jackrabbit:" - while [[ -z `curl -s "http://localhost:8080"` ]] ; do sleep 1s; echo -n "."; done - app/console doctrine:phpcr:workspace:create sandbox - app/console doctrine:phpcr:repository:init - app/console doctrine:phpcr:fixtures:load - EOH -end diff --git a/vagrant/cookbook/templates/default/jackrabbit.erb b/vagrant/cookbook/templates/default/jackrabbit.erb deleted file mode 100644 index ac5db8a8..00000000 --- a/vagrant/cookbook/templates/default/jackrabbit.erb +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash -### BEGIN INIT INFO -# Provides: jackrabbit -# Short-Description: Start/stop Jackrabbit JCR server. -# -# Description: This relies on a PID file to check if Jackrabbit is running. -# If you kill Jackrabbit without removing the PID file, you -# will not be able to start Jackrabbit with this script until -# you manually remove the PID file. -# Edit the variables below to configure Jackrabbit -# Depending on the storage backend, you might want to adjust -# the required start / stop lines. -# -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Required-Start: -# Required-Stop: -# -# Author: Daniel Barsotti -# Bastian Widmer -# -# Modified by -### END INIT INFO - - -### PLEASE EDIT THESE VALUES FOR YOUR SETUP -# Directory in which jackrabbit will store local data, must be writeable -BASEDIR=/opt/jackrabbit -# Full filename of jackrabbit standalone .jar to run -JACKRABBIT_JAR=$BASEDIR/jackrabbit.jar -# IP address for jackrabbit to listen on. you can make jackrabbit listen on all -# interfaces by using 0.0.0.0 here. -JACKRABBIT_HOST=0.0.0.0 -# Port number to listen on. 8080 is default, you can use something else -JACKRABBIT_PORT=8080 -# Java memory allocation -MEMORY="-XX:MaxPermSize=128m -Xmx512M -Xms128M" -# Full filename to the logfile to output console output of jackrabbit -# additionally, jackrabbit has its own logfile -LOGFILE=$BASEDIR/jackrabbit.log -### - -PID=$(pgrep -f "java $MEMORY -jar $JACKRABBIT_JAR -h $JACKRABBIT_HOST -p $JACKRABBIT_PORT") - -do_start() { - if [ -z "$PID" ] ; then - cd $BASEDIR - nohup java $MEMORY -jar $JACKRABBIT_JAR -h $JACKRABBIT_HOST -p $JACKRABBIT_PORT >> $LOGFILE 2>&1 & - # Wait until the server is ready (from an idea of Christoph Luehr) - echo "Jackrabbit started in the background" - else - echo "Jackrabbit is already running" - fi -} - -do_stop() { - if ! [ -z "$PID" ] ; then - kill "$PID" - echo "Jackrabbit stopped" - else - echo "Jackrabbit is not running" - fi - exit 3 -} - -do_status() { - if ! [ -z "$PID" ]; then - echo "Jackrabbit is running [ pid = "$PID"]" - else - echo "Jackrabbit is not running" - exit 3 - fi -} - -case "$1" in - start) - do_start - ;; - stop) - do_stop - ;; - status) - do_status - ;; - *) - echo "Usage: $SCRIPTNAME {start|stop|status}" >&2 - exit 3 - ;; -esac diff --git a/vagrant/cookbook/templates/default/vhost.conf.erb b/vagrant/cookbook/templates/default/vhost.conf.erb deleted file mode 100644 index 60754a14..00000000 --- a/vagrant/cookbook/templates/default/vhost.conf.erb +++ /dev/null @@ -1,13 +0,0 @@ -# Override the Apache User (vhosts are included at the end of apache2.conf) -User vagrant -Group vagrant - - - Servername cmf.lo - Serveralias 172.22.22.22 - DocumentRoot /vagrant/web - - AllowOverride All - - -