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

Drupal staging with git and drush

Drupal staging with git and drush

at Drupal Dev Days Barcelona 2012

Markus Heurung

June 16, 2012
Tweet

More Decks by Markus Heurung

Other Decks in Technology

Transcript

  1. write-write conflict multiple developers index.php update.php modules/ includes/ sites/ …

    index.php update.php modules/ includes/ sites/ … Dienstag, 7. Mai 13
  2. the typical local git workflow $ [work …] $ git

    commit -am "meaningful message" $ [work …] $ git add sites/all/modules/custom/stuff/ $ git commit -am "added stuff module" Dienstag, 7. Mai 13
  3. index.php update.php modules/ includes/ sites/ … transfer commits local integration

    index.php update.php modules/ includes/ sites/ … pull push Dienstag, 7. Mai 13
  4. some drush basics $ drush pm-downlaod views $ drush pm-enable

    views $ drush pm-disable devel_themer $ drush pm-update $ drush updatedb $ drush variable_set site_offline 1 Dienstag, 7. Mai 13
  5. drush site-aliases aliases.drushrc.php $aliases['integration'] = array( 'uri' => 'integration.server', 'root'

    => '/var/www/integration.server/docroot', 'remote-host' => 'integration.server', 'remote-user' => 'integration-user' ); Dienstag, 7. Mai 13
  6. use drush to sync files $ drush rsync \\ default:%files

    @integration:%files Dienstag, 7. Mai 13
  7. in $aliases['integration'] 'databases' => array( 'default' => array( 'default' =>

    array( 'driver' => 'mysql', 'database' => 'integration', 'username' => 'integration', 'password' => 'supersecret', 'host' => 'localhost', 'prefix' => '', 'collation' => 'utf8_general_ci', ), ), ), Dienstag, 7. Mai 13
  8. in $aliases['integration'] 'path-aliases' => array( '%dump-dir' => '/home/integration-user/db-dumps', ), 'command-specific'

    => array( 'sql-sync' => array ( 'no-cache' => TRUE, 'sanitize' => TRUE, 'structure-tables' => array( 'common' => array('cache', 'cache_menu', '…', 'sessions', 'watchdog'), ), Dienstag, 7. Mai 13
  9. dev A dev B integration index.php update.php modules/ includes/ sites/

    … Git is a distributed VCS Dienstag, 7. Mai 13
  10. • no forgotten files • much faster uploads • version

    history • teamwork summary Dienstag, 7. Mai 13
  11. • no forgotten files • much faster uploads • version

    history • teamwork • deployment to docroot on the server summary Dienstag, 7. Mai 13
  12. • no forgotten files • much faster uploads • version

    history • teamwork • deployment to docroot on the server • put as much in code as possible summary Dienstag, 7. Mai 13
  13. • no forgotten files • much faster uploads • version

    history • teamwork • deployment to docroot on the server • put as much in code as possible • features, strongarm, install profiles, … summary Dienstag, 7. Mai 13
  14. • no forgotten files • much faster uploads • version

    history • teamwork • deployment to docroot on the server • put as much in code as possible • features, strongarm, install profiles, … • hook_update_N summary Dienstag, 7. Mai 13