drupal session 4


                                            Drupal version control
                                            @netnode
                                            Topic: Drupal version control @netnode
                                            Date: 27.02.2012
                                            Presenter: Pascal Arnet
                                            Twitter: @netnode
                                            Blog: http://www.netnode.ch/blog




http://www.netnode.ch - pure drupal - drupal development services
What we ll know in 15min?


•  SVN Checkout to webroot
•  Handle settings.php
•  SVN property svn:ignore
•  Drush module upgrade together with SVN
•  SVN Dos and Don’ts
Checkout to webroot


•  uid of SVN checkout is important to work
  with Webserver gid/uid
•  FTP user with shell access. Strong passwords
•  svn co http://URL/svn/REPO_NAME/trunk .
•  Do not use root for checkout
Handle settings.php

 •  Problems
  •  Different configuration (dev/test/
    production) for the same project (db,
    error_reporting)
  •  Different developers with custom setup
  •  if ($_SERVER['http_host’] ==
    ‘dev.netnode.me’) {
    } else {
    }
Handle settings.php

 •  Solution
  •  Different settings.php files (settings-dev,
    settings-test, settings-prod, setttings-
    pascal)
  •  Make symlink or copy as settings.php
  •  Exclude settings.php from SVN
  •  Include settings-global.php for common
    settings
SVN property svn:ignore


•  Filter for directory content
•  svn propset svn:ignore "*" log/	

•  svn propedit svn:ignore .	

•  export SVN_EDITOR=vim	

•  ?, *, [ ] as patterns	

•  sites/default/files
•  sites/default/settings.php
Drush module upgrade with SVN




•  Drush up --version-control=svn --svnsync
  --svncommit
SVN Dos and Don’ts

•  Dos
 •  Commit often
 •  Commit at least once a day
 •  Use http:// notation of checkout URL
•  Don’ts
 •  svn add –force *
 •  svn co/up with user root
More information?


•  http://buildamodule.com/video/change-
  management-and-version-control-how-to-
  override-shared-features-and-modify-text-how-
  to-use-a-version-controlled-settings-php-
  include-to-share-settings
•  http://svnbook.red-bean.com/en/1.5/
  svn.advanced.props.special.ignore.html
•  Drush help up
Discussion




 •  Questions?
drupal pur
   www.netnode.ch

drupal session 4 - drupal version control at netnode

  • 1.
    drupal session 4 Drupal version control @netnode Topic: Drupal version control @netnode Date: 27.02.2012 Presenter: Pascal Arnet Twitter: @netnode Blog: http://www.netnode.ch/blog http://www.netnode.ch - pure drupal - drupal development services
  • 2.
    What we llknow in 15min? •  SVN Checkout to webroot •  Handle settings.php •  SVN property svn:ignore •  Drush module upgrade together with SVN •  SVN Dos and Don’ts
  • 3.
    Checkout to webroot • uid of SVN checkout is important to work with Webserver gid/uid •  FTP user with shell access. Strong passwords •  svn co http://URL/svn/REPO_NAME/trunk . •  Do not use root for checkout
  • 4.
    Handle settings.php • Problems •  Different configuration (dev/test/ production) for the same project (db, error_reporting) •  Different developers with custom setup •  if ($_SERVER['http_host’] == ‘dev.netnode.me’) { } else { }
  • 5.
    Handle settings.php • Solution •  Different settings.php files (settings-dev, settings-test, settings-prod, setttings- pascal) •  Make symlink or copy as settings.php •  Exclude settings.php from SVN •  Include settings-global.php for common settings
  • 6.
    SVN property svn:ignore • Filter for directory content •  svn propset svn:ignore "*" log/ •  svn propedit svn:ignore . •  export SVN_EDITOR=vim •  ?, *, [ ] as patterns •  sites/default/files •  sites/default/settings.php
  • 7.
    Drush module upgradewith SVN •  Drush up --version-control=svn --svnsync --svncommit
  • 8.
    SVN Dos andDon’ts •  Dos •  Commit often •  Commit at least once a day •  Use http:// notation of checkout URL •  Don’ts •  svn add –force * •  svn co/up with user root
  • 9.
    More information? •  http://buildamodule.com/video/change- management-and-version-control-how-to- override-shared-features-and-modify-text-how- to-use-a-version-controlled-settings-php- include-to-share-settings •  http://svnbook.red-bean.com/en/1.5/ svn.advanced.props.special.ignore.html •  Drush help up
  • 10.
  • 11.
    drupal pur www.netnode.ch