Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
~Prescott, Flickr




Drupal, Subversion & CVS
A site maintenance cocktail

April 23, 2009
Before we begin...


✤   This isn’t a “How to use Subversion” tutorial.
    ✤   5 min. overview of Subversion
    ✤   Want...
Before we begin...



✤   Why are we doing this?
✤   Mixing CVS and Subversion: Hold on to your butts!
✤   Module recommen...
Shortcuts (core)

✤   Create or update ~/.bash_profile
    export PATH=$PATH:/usr/local/bin



✤   Checking out Drupal core...
Shortcuts (module)


✤   Checking out modules from Drupal CVS
    ✤   Create the shortcut command, drcvs_module in /usr/lo...
Shortcuts (theme)


✤   Checking out themes from Drupal CVS
    ✤   Create the shortcut command, drcvs_theme in /usr/local...
Shortcuts


✤   A cleanup shortcut, drcvs_cleanup
    #!/bin/bash

    for FILE in `svn status $1 | grep '?'`; do svn add ...
A version controlled site from
scratch
✤   Navigate to a Subversion check into which you’ll put the new site
    OR Create...
Drupal core



✤   Checkout Drupal core (version 6.9 We’ll update to 6.10 in a bit...)
    $ cd /path/to/subversion/branch...
Modules & Themes

✤   Add module and theme folders
    $ mkdir sites/all/modules sites/all/themes

    $ svn add sites/all...
Modules & Themes



✤   Checkout theme
    $ drcvs_theme zen 6--1-0



✤   Add / commit theme to Subversion
    $ svn add ...
Updating from CVS


✤   Update Drupal core to 6.10
    $ cd /path/to/drupal

    $ cvs up -dP -r DRUPAL-6-10

    $ drcvs_...
Ignoring files



✤   Occasionally you’ll want Subversion to ignore files, i.e. settings.php
✤   Before you’ve added the fil...
Referencing external Subversion
projects

✤   Create an external reference to ASU Zen theme
    $ cd /path/to/themes

    ...
Upcoming SlideShare
Loading in …5
×

ASU DUG - SVN and CVS

674 views

Published on

Presentation to Arizona State University's Drupal Users Group in April, 2009.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

ASU DUG - SVN and CVS

  1. 1. ~Prescott, Flickr Drupal, Subversion & CVS A site maintenance cocktail April 23, 2009
  2. 2. Before we begin... ✤ This isn’t a “How to use Subversion” tutorial. ✤ 5 min. overview of Subversion ✤ Want to learn more? Subversion Handbook ✤ CVS: similar to Subversion, but conceptually different in places
  3. 3. Before we begin... ✤ Why are we doing this? ✤ Mixing CVS and Subversion: Hold on to your butts! ✤ Module recommendation: CVS Deploy
  4. 4. Shortcuts (core) ✤ Create or update ~/.bash_profile export PATH=$PATH:/usr/local/bin ✤ Checking out Drupal core from Drupal CVS (OS X) ✤ Create the shortcut command, drcvs_core in /usr/local/bin/ #!/bin/bash cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co -d $1 -r DRUPAL-$2 drupal ✤ Make the file executable $ chmod ugo+x /usr/local/bin/drcvs_core
  5. 5. Shortcuts (module) ✤ Checking out modules from Drupal CVS ✤ Create the shortcut command, drcvs_module in /usr/local/bin/ #!/bin/bash cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-$2 -d $1 contributions/modules/$1 ✤ Make the file executable
  6. 6. Shortcuts (theme) ✤ Checking out themes from Drupal CVS ✤ Create the shortcut command, drcvs_theme in /usr/local/bin/ #!/bin/bash cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -r DRUPAL-$2 -d $1 contributions/themes/$1 ✤ Make the file executable
  7. 7. Shortcuts ✤ A cleanup shortcut, drcvs_cleanup #!/bin/bash for FILE in `svn status $1 | grep '?'`; do svn add $FILE; done; for FILE in `svn status $1 | grep '!'`; do svn rm $FILE; done; ✤ Aack! WTF is that mess?!?! 1. Find any new files (‘?’) and add them to SVN 2. Find any files that were removed (‘!’) and remove them from SVN
  8. 8. A version controlled site from scratch ✤ Navigate to a Subversion check into which you’ll put the new site OR Create a (empty) home for your site in Subversion and check it out elsewhere ✤ Check out Drupal core from CVS, then add to Subversion ✤ Check out modules / themes from CVS, then add to Subversion ✤ Updating modules or core ✤ Ignoring files ✤ Referencing external Subversion projects
  9. 9. Drupal core ✤ Checkout Drupal core (version 6.9 We’ll update to 6.10 in a bit...) $ cd /path/to/subversion/branches/folder $ drcvs_core cvs-demo 6-9 ✤ Add to Subversion $ svn add cvs-demo $ svn commit -m "Adding drupal core for cvs demo site"
  10. 10. Modules & Themes ✤ Add module and theme folders $ mkdir sites/all/modules sites/all/themes $ svn add sites/all/modules sites/all/themes $ svn commit sites/all/ -m "Add module and theme container folders" ✤ Checkout modules $ cd sites/all/modules $ drcvs_module cck 6--2-2 $ drcvs_module views 6--2-4 $ drcvs_module cvs_deploy 6--1-0 ✤ Add / commit modules to Subversion $ svn add * $ svn commit -m "Add CCK, Views and CVS Deploy modules"
  11. 11. Modules & Themes ✤ Checkout theme $ drcvs_theme zen 6--1-0 ✤ Add / commit theme to Subversion $ svn add zen $ svn commit -m "Add Zen theme"
  12. 12. Updating from CVS ✤ Update Drupal core to 6.10 $ cd /path/to/drupal $ cvs up -dP -r DRUPAL-6-10 $ drcvs_cleanup . $ svn commit -m "Update to Drupal 6.10" ✤ Update Views to 6.x-2.5 $ cd /path/to/views $ cvs up -dP -r DRUPAL-6--2-5 $ drcvs_cleanup . $ svn commit -m "Update to Views 6.x-2.5"
  13. 13. Ignoring files ✤ Occasionally you’ll want Subversion to ignore files, i.e. settings.php ✤ Before you’ve added the file to Subversion $ cd /path/to/sites/default $ svn propedit svn:ignore . # Add ‘settings.php’ to the first line of the file and save it $ svn commit . -m "Ignore settings.php"
  14. 14. Referencing external Subversion projects ✤ Create an external reference to ASU Zen theme $ cd /path/to/themes $ svn propedit svn:externals . ✤ Add the following to new line(s) in the file asuzen https://opensource.asu.edu/svn/asuzen/branches/asuzen-6.x/ ✤ Retrieve the external project and commit the change $ svn up $ svn commit -m "Add external reference to ASU Zen theme"

×