Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/v1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Rombauts committed Nov 5, 2015
2 parents 1c9bacc + 43c589e commit 3a8634e
Show file tree
Hide file tree
Showing 378 changed files with 11,709 additions and 656 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ www/*
!www/logs/tail
!www/index.php
config.custom.yaml
/packer_cache
/packer_cache
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ in 1.x versions.
To get the diff for a specific change, go to https://github.com/joomlatools/joomla-vagrant/commit/xxx where xxx is the change hash.
To view the diff between two versions, go to https://github.com/joomlatools/joomla-vagrant/compare/v1.0.0...v1.0.1

* 1.4.0 (2015-10-19)
* Added - `box php:engine hhvm` command to switch to HHVM
* Added - `box xdebug:profiler start|stop` command to turn on Xdebug profiling
* Added - [Zend Z-Ray](http://www.zend.com/en/products/z-ray/z-ray-preview) preview
* Added - [httpie](https://github.com/jkbrzt/httpie) CLI HTTP Client
* Added - [Cloudcommander](http://cloudcmd.io/) web-based file browser
* Added - System will automatically look for [joomlatools/joomla-console](http://developer.joomlatools.com/tools/console.html) updates
* Added - Installed Varnish cache in front of Apache
* Added - Automatically backup and restore virtual hosts and databases when upgrading the box
* Fixed - Upgraded Webgrind to automatically find cachegrind files
* Fixed - Consolidate the PHP ini files into a single custom.ini file
* Improved - Automatically change directory to /var/www when logging in via `vagrant ssh` or web terminal
* Improved - Added /terminal, /mailcatcher and /filebrowser aliases
* Improved - Added bash autocompletion to the `box` command

* 1.3.1 (2015-09-03)
* Added - Support for PHP7
* Added - Support for [joomla-platform](https://github.com/joomlatools/joomla-platform) installations
Expand Down
36 changes: 35 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
require "yaml"
require "json"

# Check for required plugins and install if missing
required_plugins = %w( vagrant-triggers )
required_plugins.each do |plugin|
exec "vagrant plugin install #{plugin};vagrant #{ARGV.join(" ")}" unless Vagrant.has_plugin? plugin || ARGV[0] == 'plugin'
end

# Initialize config
def deep_merge!(target, data)
merger = proc{|key, v1, v2|
Expand All @@ -27,7 +33,7 @@ CONF = _config

Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "joomlatools.dev"
config.vm.hostname = "joomlatools" # Important: we use this in joomla-console to determine if we are being run in the Vagrant box or not!

config.vm.network :private_network, ip: "33.33.33.58"
config.ssh.forward_agent = true
Expand Down Expand Up @@ -67,4 +73,32 @@ Vagrant.configure("2") do |config|
"pma_controluser_password" => "awesome"
}
end

config.trigger.before :destroy do
while true
print "Do you want to backup your virtual hosts and databases first? [y/N] "
case STDIN.gets.strip
when 'Y', 'y', 'yes'
run_remote "/bin/bash /home/vagrant/triggers/backup.sh"
break
when /\A[nN]o?\Z/ #n or no
break
end
end
end

config.trigger.after :up do
if File.exist?('./joomla-box-backup.tar')
while true
print "Backup archive found. Do you want to restore the backup file? [y/N] "
case STDIN.gets.strip
when 'Y', 'y', 'yes'
run_remote "/bin/bash /home/vagrant/triggers/restore.sh"
break
when /\A[nN]o?\Z/ #n or no
break
end
end
end
end
end
34 changes: 34 additions & 0 deletions Vagrantfile.pkg
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
require "yaml"
require "json"

# Check for required plugins and install if missing
required_plugins = %w( vagrant-triggers )
required_plugins.each do |plugin|
exec "vagrant plugin install #{plugin};vagrant #{ARGV.join(" ")}" unless Vagrant.has_plugin? plugin || ARGV[0] == 'plugin'
end

# Initialize config
def deep_merge!(target, data)
merger = proc{|key, v1, v2|
Expand Down Expand Up @@ -53,4 +59,32 @@ Vagrant.configure("2") do |config|

config.vm.provision :shell, :inline => shell_cmd, :run => "always"
end

config.trigger.before :destroy do
while true
print "Do you want to backup your virtual hosts and databases first? [y/N] "
case STDIN.gets.strip
when 'Y', 'y', 'yes'
run_remote "/bin/bash /home/vagrant/triggers/backup.sh"
break
when /\A[nN]o?\Z/ #n or no
break
end
end
end

config.trigger.after :up do
if File.exist?('./joomla-box-backup.tar')
while true
print "Backup archive found. Do you want to restore the backup file? [y/N] "
case STDIN.gets.strip
when 'Y', 'y', 'yes'
run_remote "/bin/bash /home/vagrant/triggers/restore.sh"
break
when /\A[nN]o?\Z/ #n or no
break
end
end
end
end
end
2 changes: 1 addition & 1 deletion packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"artifact_type": "vagrant.box",
"metadata": {
"provider": "virtualbox",
"version": "1.3.1"
"version": "1.4.0"
}
}]
]
Expand Down
138 changes: 100 additions & 38 deletions puppet/manifests/default.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group { 'puppet': ensure => present }
Exec { path => [ '/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/', '/usr/local/bin/' ] }
Exec { path => [ '/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/', '/usr/local/bin/' ], timeout => 900 }
File { owner => 0, group => 0, mode => 0644 }

user { 'vagrant': }
Expand All @@ -15,7 +15,7 @@

apt::key { '4F4EA0AAE5267A6C': }

apt::ppa { 'ppa:ondrej/php5':
apt::ppa { 'ppa:ondrej/php5-5.6':
require => Apt::Key['4F4EA0AAE5267A6C']
}

Expand All @@ -32,6 +32,8 @@

file { '/home/vagrant/.bash_aliases':
ensure => 'present',
owner => vagrant,
group => vagrant,
source => 'puppet:///modules/puphpet/dot/.bash_aliases',
}

Expand Down Expand Up @@ -68,12 +70,21 @@
require => Class['apache::certificate'],
}

exec { 'apache-set-servername':
command => "echo \"ServerName joomlatools\" > /etc/apache2/conf-available/fqdn.conf; a2enconf fqdn",
path => ['/usr/bin' , '/bin', '/usr/sbin/'],
creates => '/etc/apache2/conf-available/fqdn',
require => Class['apache']
}

apache::dotconf { 'custom':
content => template("apache/custom.conf.erb"),
}

apache::module { 'rewrite': }
apache::module { 'ssl': }
apache::module { 'proxy_fcgi': }
apache::module { 'headers': }

class { 'php':
service => 'apache',
Expand All @@ -82,6 +93,17 @@
require => Package['apache'],
}

$apache_hhvm_proxy = "
<FilesMatch \\.php$>
SetHandler \"proxy:fcgi://127.0.0.1:9000\"
</FilesMatch>"

file { '/etc/apache2/conf-available/hhvm.conf':
ensure => file,
content => $apache_hhvm_proxy,
require => Class['apache']
}

php::module { 'php5-mysql': }
php::module { 'php5-cli': }
php::module { 'php5-curl': }
Expand Down Expand Up @@ -128,11 +150,38 @@
value => [
'extension=yaml.so'
],
ini => '/etc/php5/mods-available/zzz_yaml.ini',
ini => '/etc/php5/mods-available/yaml.ini',
notify => Service['apache'],
require => [Class['php'], Php::Pecl::Module['yaml']]
}

file { ['/etc/php5/apache2/conf.d/20-yaml.ini', '/etc/php5/cli/conf.d/20-yaml.ini']:
ensure => link,
target => '/etc/php5/mods-available/yaml.ini',
require => Puphpet::Ini['yaml']
}

php::pecl::module { 'oauth':
use_package => no,
ensure => present,
require => Php::Pear::Config['download_dir']
}

puphpet::ini { 'oauth':
value => [
'extension=oauth.so'
],
ini => '/etc/php5/mods-available/oauth.ini',
notify => Service['apache'],
require => [Class['php'], Php::Pecl::Module['oauth']]
}

file { ['/etc/php5/apache2/conf.d/20-oauth.ini', '/etc/php5/cli/conf.d/20-oauth.ini']:
ensure => link,
target => '/etc/php5/mods-available/oauth.ini',
require => Puphpet::Ini['oauth']
}

class { 'xdebug':
service => 'apache',
}
Expand All @@ -141,24 +190,13 @@
require => Package['php5', 'curl'],
}

puphpet::ini { 'xdebug':
value => [
'xdebug.remote_autostart = 0',
';Use remote_connect_back = 0 if accessing a shared box',
'xdebug.remote_connect_back = 1',
'xdebug.remote_enable = 1',
'xdebug.remote_handler = "dbgp"',
'xdebug.remote_port = 9000',
'xdebug.remote_host = "33.33.33.1"',
'xdebug.show_local_vars = 1',
'xdebug.profiler_enable = 0',
'xdebug.profiler_enable_trigger = 1',
'xdebug.max_nesting_level = 1000',
'xdebug.profiler_output_dir = /var/www/logs/xdebug/'
],
ini => '/etc/php5/mods-available/zzz_xdebug.ini',
notify => Service['apache'],
require => Class['php'],
exec { "composer-plugin-changelogs":
command => "composer global require pyrech/composer-changelogs",
path => ['/usr/bin' , '/bin'],
creates => '/home/vagrant/.composer/vendor/pyrech/composer-changelogs',
user => vagrant,
environment => 'COMPOSER_HOME=/home/vagrant/.composer',
require => Class['Composer']
}

puphpet::ini { 'custom':
Expand All @@ -170,23 +208,28 @@
'upload_max_filesize = "256M"',
'post_max_size = "256M"',
'memory_limit = "256M"',
'date.timezone = "UTC"'
'date.timezone = "UTC"',
'xdebug.remote_autostart = 0',
'xdebug.remote_connect_back = 1',
'xdebug.remote_enable = 1',
'xdebug.remote_handler = "dbgp"',
'xdebug.remote_port = 9000',
'xdebug.remote_host = "33.33.33.1"',
'xdebug.show_local_vars = 1',
'xdebug.profiler_enable = 0',
'xdebug.profiler_enable_trigger = 0',
'xdebug.max_nesting_level = 1000',
'xdebug.profiler_output_dir = /var/www/'
],
ini => '/etc/php5/mods-available/zzz_custom.ini',
ini => '/etc/php5/mods-available/custom.ini',
notify => Service['apache'],
require => Class['php'],
}

exec {'symlink-custom-ini-files-apache':
command => 'find /etc/php5/mods-available/ -name "zzz_*" -exec /bin/bash -c \'ln -s {} /etc/php5/apache2/conf.d/`basename $0`\' {} \;',
unless => 'bash -c "test -f /etc/php5/apache2/conf.d/zzz_custom.ini"',
require => [Puphpet::Ini['custom'], Puphpet::Ini['yaml'], Puphpet::Ini['xdebug']]
}

exec {'symlink-custom-ini-files-cli':
command => 'find /etc/php5/mods-available/ -name "zzz_*" -exec /bin/bash -c \'ln -s {} /etc/php5/cli/conf.d/`basename $0`\' {} \;',
unless => 'bash -c "test -f etc/php5/cli/conf.d/zzz_custom.ini"',
require => [Puphpet::Ini['custom'], Puphpet::Ini['yaml'], Puphpet::Ini['xdebug']]
file { ['/etc/php5/apache2/conf.d/99-custom.ini', '/etc/php5/cli/conf.d/99-custom.ini']:
ensure => link,
target => '/etc/php5/mods-available/custom.ini',
require => Puphpet::Ini['custom']
}

class { 'mysql::server':
Expand All @@ -209,7 +252,7 @@
server_name => 'phpmyadmin',
serveraliases => 'phpmyadmin.joomla.box',
docroot => '/usr/share/phpmyadmin',
port => 80,
port => 8080,
priority => '10',
require => Class['phpmyadmin'],
}
Expand Down Expand Up @@ -244,16 +287,16 @@
apache::vhost { 'webgrind':
server_name => 'webgrind',
serveraliases => 'webgrind.joomla.box',
docroot => '/usr/share/webgrind',
port => 80,
docroot => '/usr/share/webgrind-1.2',
port => 8080,
priority => '10',
require => Class['webgrind'],
}

apache::vhost { 'joomla.box':
server_admin => 'webmaster@localhost',
serveraliases => 'localhost',
port => 80,
port => 8080,
priority => '00',
docroot => '/var/www',
directory => '/var/www',
Expand Down Expand Up @@ -317,6 +360,7 @@
}

class {'wetty': }
class {'cloudcommander': }

file { '/etc/update-motd.d/999-joomlatools':
ensure => 'present',
Expand All @@ -340,7 +384,25 @@
require => Apt::Ppa['ppa:resmo/git-ftp']
}

package { 'httpie':
ensure => latest
}

swap_file::files { 'default':
ensure => present,
swapfilesize => '512 MB'
}
}

class { 'hhvm':
manage_repos => true,
pgsql => false
}

class {'triggers': }

class { 'varnish': }

class { 'zray':
notify => Service['apache'],
require => Class['php']
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@

Alias /dashboard /home/vagrant/scripts/dashboard
Alias /pimpmylog /usr/share/pimpmylog/vendor/potsky/pimp-my-log
Alias /varnish-enabled /home/vagrant/scripts/varnish-enabled

Redirect permanent /terminal http://joomla.box:3000
Redirect permanent /mailcatcher http://joomla.box:1080
Redirect permanent /filebrowser http://joomla.box:8001/fs/var/www

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$
Expand Down
3 changes: 3 additions & 0 deletions puppet/modules/archive/.fixtures.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fixtures:
symlinks:
archive: "#{source_dir}"
Loading

0 comments on commit 3a8634e

Please sign in to comment.