Embed
Email

Drupal_ Subversion _ CVS

Document Sample

Shared by: hedongchenchen
Categories
Tags
Stats
views:
0
posted:
12/2/2011
language:
English
pages:
14
~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 to learn more? Subversion Handbook

✤ CVS: similar to Subversion, but conceptually different in places

Before we begin...







✤ Why are we doing this?

✤ Mixing CVS and Subversion: Hold on to your butts!

✤ Module recommendation: CVS Deploy

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

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

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

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

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

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"

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"

Modules & Themes







✤ Checkout theme

$ drcvs_theme zen 6--1-0







✤ Add / commit theme to Subversion

$ svn add zen



$ svn commit -m "Add Zen theme"

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"

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"

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"



Related docs
Other docs by hedongchenchen
AMS11-AV-Order-form
Views: 0  |  Downloads: 0
Rural Telephone Bank
Views: 5  |  Downloads: 0
04tbl2-32a
Views: 0  |  Downloads: 0
CG9 Licence No.
Views: 0  |  Downloads: 0
1996
Views: 0  |  Downloads: 0
2011 CATALOG
Views: 11  |  Downloads: 0
NEURO-_summary.doc - STJ PA 2012
Views: 1  |  Downloads: 0
1995-1996 Prepaid Health Plan Contract
Views: 0  |  Downloads: 0
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!