Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vagrant and Magento Sitting in a Tree...

Max Bucknell
September 03, 2014

Vagrant and Magento Sitting in a Tree...

A talk about how to get Vagrant, Puppet and Fabric to all sing along with Magento.

Magento London, 2014-09-03

Max Bucknell

September 03, 2014
Tweet

More Decks by Max Bucknell

Other Decks in Technology

Transcript

  1. Lots of reasons “It works on my machine” Improve set

    up time Simplify deployment Fun Consistency Testing infrastructure Less tech support
  2. [vagrant@localhost ~]$ ssh -t [email protected] logged in as maxbucknell. !

    You can use git or hg to connect to Bitbucket. Shell access is disabled. Connection to bitbucket.org closed.
  3. /** * Nginx * Version 1.4.4 */ ! package {

    'nginx': ensure => '1.4.4-1.el6.ngx', notify => File['/etc/nginx/nginx.conf'], }
  4. /** * Nginx configuration, optimised for Magento. */ ! file

    { '/etc/nginx/nginx.conf': ensure => 'present', source => '/vagrant/server_config/etc/nginx/ nginx.conf', notify => Service['nginx'], }
  5. /** * Composer */ ! exec { 'curl -sS https://getcomposer.org/installer

    | php': cwd => '/usr/local/bin', creates => '/usr/local/bin/composer.phar', path => '/usr/local/bin:/usr/bin', }
  6. @task def clean_up(): """Clear out installed files""" local('/bin/rm -rf %s'

    % magento_root) local('/bin/rm -rf %s/vendor' % project_root)
  7. @task
 def get_database_dump(): """Get a database dump from the server."""

    db_filename = random_filename('sql') db_location = os.path.join(config['tmp_dir'], db_filename) with cd(config['magento_root']): run('%s db:dump -f %s --strip="@development"' % (config['magerun'], db_location)) get(remote_path=db_location, local_path='/tmp') with lcd(magento_root): local('n98-magerun.phar db:import %s' % '/tmp/' + db_filename)