Slides for April 2009 ASU Drupal Users Group
Attached below are the slides for the April, 2009 ASU Drupal Users Group presentation I gave on maintaining sites using a combination of CVS (to checkout Drupal core and contrib modules) and Subversion (for backing up your site's code base and integrating with locally maintained modules and themes).
Here's a quick rundown of links mentioned in the presentation:
- 5 minute overview of Subversion (video)
- Subversion Handbook
- CVS Handbook
- CVS Deploy module for Drupal
Read on after the break for code samples.
A quick reference for the shell scripts we created (OS X):
Create or update ~/.bash_profile
Bash script for checking out Drupal core
Create the shortcut command, drcvs_core in /usr/local/bin/:
Make the file executable:
Bash script for checking out Drupal modules
Note: Be sure to make the bash script executable (see above).
Create the shortcut command, drcvs_module in /usr/local/bin/:
Bash script for checking out Drupal themes
Note: Be sure to make the bash script executable (see above).
Create the shortcut command, drcvs_theme in /usr/local/bin/:
Bash script for cleaning up for Subversion after a CVS update
Note: Be sure to make the bash script executable (see above).
Create the shortcut command, drcvs_cleanup in /usr/local/bin/:
for FILE in `svn status $1 | grep '?'`; do svn add $FILE; done;
for FILE in `svn status $1 | grep '!'`; do svn rm $FILE; done;
Sample usage
Checkout Drupal core from CVS and commit to Subversion
drcvs_core cvs-demo 6-9
svn add cvs-demo
svn commit -m "Adding drupal core for cvs demo site"
Checkout modules from CVS and add to Subversion
drcvs_module cck 6--2-2
drcvs_module views 6--2-4
drcvs_module cvs_deploy 6--1-0
svn add *
svn commit -m "Add CCK, Views and CVS Deploy modules"
Checkout a theme from CVS and add to Subversion
svn add zen
svn commit -m "Add Zen theme"
Updating Drupal core or modules from CVS
cvs up -dP -r DRUPAL-6-10
drcvs_cleanup .
svn commit -m "Update to Drupal 6.10"
cd /path/to/views
cvs up -dP -r DRUPAL-6--2-5
drcvs_cleanup .
svn commit -m "Update to Views 6.x-2.5"
Telling Subversion to ignore files
svn propedit svn:ignore .
# Add ‘settings.php’ to the first line of the file and save it
svn commit . -m "Ignore settings.php"
Referencing an external Subversion project
svn propedit svn:externals .
Add the following to new line(s) in the file
Retrieve the external project and commit the change
svn commit -m "Add external reference to ASU Zen theme"
| Attachment | Size |
|---|---|
| ASU DUG - SVN and CVS.pdf | 1.33 MB |

Comments
Thanks buddy, this has been real helpful. My first time working with SVN CVS and it worked great thank to this article.
thanks for the tips, i think a lot of this makes my life a lot easier. great post!
Hi! I just wanted to say thanks for this great presentation!
I have been preaching this exact setup for these exact reasons exactly! But lacked this awesome presentation material to just simply explain it.
Post new comment