drupal session 4 - drupal version control at netnode

11

Click here to load reader

Upload: netnode-it-services-gmbh

Post on 17-May-2015

1.144 views

Category:

Technology


0 download

DESCRIPTION

Every day, we deal with version control. It's good to know about the best practices, especially in Drupal projects.Pascal updated all developers at netnode about how we work with SVN and gave us a tips and hints.More about that on http://www.netnode.ch/blog

TRANSCRIPT

Page 1: drupal session 4 - drupal version control at netnode

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

Page 2: drupal session 4 - drupal version control at netnode

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

Page 3: drupal session 4 - drupal version control at netnode

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

Page 4: drupal session 4 - drupal version control at netnode

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 { }

Page 5: drupal session 4 - drupal version control at netnode

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

Page 6: drupal session 4 - drupal version control at netnode

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

Page 7: drupal session 4 - drupal version control at netnode

Drush module upgrade with SVN

• Drush up --version-control=svn --svnsync --svncommit

Page 8: drupal session 4 - drupal version control at netnode

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

Page 9: drupal session 4 - drupal version control at netnode

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

Page 10: drupal session 4 - drupal version control at netnode

Discussion

• Questions?

Page 11: drupal session 4 - drupal version control at netnode

drupal pur www.netnode.ch