Drupal devdays barcelona 2012 – Staging with git and drush
Upcoming SlideShare
Loading in...5
×
 

Drupal devdays barcelona 2012 – Staging with git and drush

on

  • 805 views

 

Statistics

Views

Total Views
805
Views on SlideShare
761
Embed Views
44

Actions

Likes
1
Downloads
5
Comments
0

1 Embed 44

http://www.freistil.it 44

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Drupal devdays barcelona 2012 – Staging with git and drush Drupal devdays barcelona 2012 – Staging with git and drush Presentation Transcript

  • Staging with git & drushDienstag, 7. Mai 13
  • freistil ITMarkus Heurung – @muhhmarkus@freistil.itDienstag, 7. Mai 13
  • „Deploying“ the old wayindex.phpupdate.phpmodules/includes/sites/…Dienstag, 7. Mai 13 View slide
  • „Deploying“ the old wayindex.phpupdate.phpmodules/includes/sites/…FTPDienstag, 7. Mai 13 View slide
  • „Deploying“ the old wayindex.phpupdate.phpmodules/includes/sites/…FTPworkDienstag, 7. Mai 13
  • „Deploying“ the old wayindex.phpupdate.phpmodules/includes/sites/…FTPworkDienstag, 7. Mai 13
  • „Deploying“ the old wayindex.phpupdate.phpmodules/includes/sites/…FTPworkDienstag, 7. Mai 13
  • „Deploying“ the old wayindex.phpupdate.phpmodules/includes/sites/…FTPworkfixDienstag, 7. Mai 13
  • „Deploying“ the old wayindex.phpupdate.phpmodules/includes/sites/…FTPworkfixDienstag, 7. Mai 13
  • „Deploying“ the old wayindex.phpupdate.phpmodules/includes/sites/…FTPworkfixDienstag, 7. Mai 13
  • multiple developersindex.phpupdate.phpmodules/includes/sites/…index.phpupdate.phpmodules/includes/sites/…Dienstag, 7. Mai 13
  • multiple developersindex.phpupdate.phpmodules/includes/sites/…index.phpupdate.phpmodules/includes/sites/…Dienstag, 7. Mai 13
  • multiple developersindex.phpupdate.phpmodules/includes/sites/…index.phpupdate.phpmodules/includes/sites/…Dienstag, 7. Mai 13
  • write-write conflictmultiple developersindex.phpupdate.phpmodules/includes/sites/…index.phpupdate.phpmodules/includes/sites/…Dienstag, 7. Mai 13
  • SUCKS!Dienstag, 7. Mai 13
  • develop locally!Dienstag, 7. Mai 13
  • XAMPP/MAMPAcquia Dev DesktopLinuxMac OS XDienstag, 7. Mai 13
  • index.phpupdate.phpmodules/includes/sites/…Dienstag, 7. Mai 13
  • index.phpupdate.phpmodules/includes/sites/…index.phpupdate.phpmodules/includes/sites/…Dienstag, 7. Mai 13
  • Version ControlDienstag, 7. Mai 13
  • GitDienstag, 7. Mai 13
  • Repositoryindex.phpupdate.phpmodules/includes/sites/…put your code into gitDienstag, 7. Mai 13
  • Repositoryindex.phpupdate.phpmodules/includes/sites/…put your code into gitDienstag, 7. Mai 13
  • Some git basics$ git add $FILE(S)$ git commit $FILE(S)Dienstag, 7. Mai 13
  • some git basics$ git add docroot/$ git commit docroot/Dienstag, 7. Mai 13
  • 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
  • Repositoryindex.phpupdate.phpmodules/includes/sites/…put your code into gitDienstag, 7. Mai 13
  • index.phpupdate.phpmodules/includes/sites/…transfer commitslocal integrationDienstag, 7. Mai 13
  • git remote repositoriesDienstag, 7. Mai 13
  • working with remotes$ git remote add integration git@integration.server:test.gitDienstag, 7. Mai 13
  • transfer commits$ git push integration$ git pull integrationDienstag, 7. Mai 13
  • index.phpupdate.phpmodules/includes/sites/…transfer commitslocal integrationpullpushDienstag, 7. Mai 13
  • index.phpupdate.phpmodules/includes/sites/…transfer commitslocal integrationindex.phpupdate.phpmodules/includes/sites/…pullpushDienstag, 7. Mai 13
  • let the serverdeploy the codeto its docrootDienstag, 7. Mai 13
  • git knows hooks!Dienstag, 7. Mai 13
  • .git/hooks/post-receive→ go to docroot and do a git pullDienstag, 7. Mai 13
  • What about sites/*/files?Dienstag, 7. Mai 13
  • not in git!Dienstag, 7. Mai 13
  • $ echo "sites/*/files" >> .gitignorelet git ignore itDienstag, 7. Mai 13
  • drushDienstag, 7. Mai 13
  • 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 1Dienstag, 7. Mai 13
  • and most used$ drush cache-clear allDienstag, 7. Mai 13
  • drush knows remotes, too!Dienstag, 7. Mai 13
  • drush knows remotes, too!called site-aliasesDienstag, 7. Mai 13
  • drush site-aliasesaliases.drushrc.phpDienstag, 7. Mai 13
  • drush site-aliasesaliases.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
  • $ drush @integration statusdrush site-aliasesDienstag, 7. Mai 13
  • syncing files directoryDienstag, 7. Mai 13
  • use drush to sync files$ drush rsync default:%files @integration:%filesDienstag, 7. Mai 13
  • syncing the databaseDienstag, 7. Mai 13
  • 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
  • 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
  • sync your database$ drush sql-sync default @integrationDienstag, 7. Mai 13
  • next problem:Dienstag, 7. Mai 13
  • multiple developersnext problem:Dienstag, 7. Mai 13
  • no problemDienstag, 7. Mai 13
  • dev Adev Bintegrationindex.phpupdate.phpmodules/includes/sites/…Dienstag, 7. Mai 13
  • dev Adev Bintegrationindex.phpupdate.phpmodules/includes/sites/…Git is a distributed VCSDienstag, 7. Mai 13
  • summaryDienstag, 7. Mai 13
  • • no forgotten filessummaryDienstag, 7. Mai 13
  • • no forgotten files• much faster uploadssummaryDienstag, 7. Mai 13
  • • no forgotten files• much faster uploads• version historysummaryDienstag, 7. Mai 13
  • • no forgotten files• much faster uploads• version history• teamworksummaryDienstag, 7. Mai 13
  • • no forgotten files• much faster uploads• version history• teamwork• deployment to docroot on the serversummaryDienstag, 7. Mai 13
  • • no forgotten files• much faster uploads• version history• teamwork• deployment to docroot on the server• put as much in code as possiblesummaryDienstag, 7. Mai 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, …summaryDienstag, 7. Mai 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, …• hook_update_NsummaryDienstag, 7. Mai 13
  • code staginga possible workflowDienstag, 7. Mai 13
  • Dienstag, 7. Mai 13
  • bossdevdevdevdevDienstag, 7. Mai 13
  • bossintegrationdevdevdevdevDienstag, 7. Mai 13
  • bossintegrationdevdevdevdevDienstag, 7. Mai 13
  • bossintegrationstagedevdevdevdevDienstag, 7. Mai 13
  • bossintegrationstagedevdevdevdevDienstag, 7. Mai 13
  • bossintegrationstagelivedevdevdevdevDienstag, 7. Mai 13
  • bossintegrationstagelivedevdevdevdevDienstag, 7. Mai 13
  • bossintegrationstagelivedevdevdevdevDienstag, 7. Mai 13
  • bossintegrationstagelivedevdevdevdevDienstag, 7. Mai 13
  • LinksGithttp://git-scm.comhttp://gitref.org/index.htmlhttp://rogerdudler.github.com/git-guide/http://sitaramc.github.com/gitolite/Drushhttp://drush.orghttp://drupal.org/documentation/modules/drushDienstag, 7. Mai 13
  • Questions!Dienstag, 7. Mai 13
  • Thank you!Dienstag, 7. Mai 13