<<O>>  Difference Topic ConfigurationManagementWithSubversion (r1.4 - 17 May 2004 - TWikiGuest)

SubVersion? is an increasingly popular substitute for CVS. One very useful application is to track changes to your local configuration files, which lets you:

  1. Keep a history of changes and why you made them.
Line: 35 to 35

# svn -m "Making CM subdirectories" mkdir file:///var/svn/hosts
# svn -m "Making CM subdirectories" mkdir file:///var/svn/hosts/cmhost
Changed:
<
<
# cd /etc # svn import -N file:///var/svn/hosts/chmost/etc etc
>
>
# svn -m "Making CM subdirectories" mkdir file:///var/svn/hosts/cmhost/etc # svn checkout file:///var/svn/hosts/chmost/etc .

That's all there is to it. Now you can use the full suite of SubVersion? commands to add, rename, and annotate files.

 <<O>>  Difference Topic ConfigurationManagementWithSubversion (r1.3 - 16 May 2004 - TWikiGuest)

SubVersion? is an increasingly popular substitute for CVS. One very useful application is to track changes to your local configuration files, which lets you:

  1. Keep a history of changes and why you made them.
Line: 35 to 35

# svn -m "Making CM subdirectories" mkdir file:///var/svn/hosts
# svn -m "Making CM subdirectories" mkdir file:///var/svn/hosts/cmhost
Changed:
<
<
# svn -m "Making CM subdirectories" mkdir file:///var/svn/hosts/cmhost/etc
  • Now, the tricky part: replacing your precious /etc directory with a VersionControl?led copy. I use RsYnc? for this step, but any tool that can exactly replicate a directory tree is perfectly acceptable:
# cd /
# svn co file:///var/svn/hosts/web2/etc etc-svn
# mv /etc-svn/.svn /etc
# rm -r /etc-svn
>
>
# cd /etc # svn import -N file:///var/svn/hosts/chmost/etc etc

That's all there is to it. Now you can use the full suite of SubVersion? commands to add, rename, and annotate files.

 <<O>>  Difference Topic ConfigurationManagementWithSubversion (r1.2 - 05 May 2004 - TWikiGuest)

SubVersion? is an increasingly popular substitute for CVS. One very useful application is to track changes to your local configuration files, which lets you:

  1. Keep a history of changes and why you made them.
Line: 41 to 41

# cd /
# svn co file:///var/svn/hosts/web2/etc etc-svn
Changed:
<
<
# rsync -av etc/ etc-svn/ # mv /etc /etc-old # mv /etc-svn /etc
  • Verify that the only difference between the old and new directory copies is that the new one is under VersionControl?:
# diff -ur /etc-old /etc
Only in /etc: .svn
>
>
# mv /etc-svn/.svn /etc # rm -r /etc-svn

That's all there is to it. Now you can use the full suite of SubVersion? commands to add, rename, and annotate files.

-- KirkStrauser - 16 Feb 2004

Added:
>
>
-- TWikiGuest - 05 May 2004 (ads@debian.org)

META FORM ClassForm  
META FIELD TopicClassification TopicClassification SystemAdministration
META FIELD OsVersion OsVersion All
 <<O>>  Difference Topic ConfigurationManagementWithSubversion (r1.1 - 16 Feb 2004 - KirkStrauser)
Line: 1 to 1
Added:
>
>
SubVersion? is an increasingly popular substitute for CVS. One very useful application is to track changes to your local configuration files, which lets you:

  1. Keep a history of changes and why you made them.
  2. Revert problematic changes.
  3. Quickly configure new machines.
  4. Propigate changes to multiple hosts.

This document is mainly concerned with the first two features; the others can be easily implemented as variations of the same setup.

Also, the examples below are for a setup where the SubVersion? repository resides on the machine being managed. If you want or need the repository on a separate host, then you'll need to configure a transport mechanism of some sort. Examples include an Apache and WebDav? interface, and building a SecureShell? tunnel. These are beyond the scope of this article.

Read through all of the steps before starting, as some necessarily involved manipulating critical system directories, and you need to assess the local impact of temporarily making certain files inaccessible before actually doing so.

Make your SubVersion? repository

  • Install SubVersion?. If you have PortUpgrade, type portinstall devel/subversion.
  • Create a repository:
# svnadmin create /var/svn

Import your configuration files

Importing an entire directory into SubVersion? is easy and well documented elsewhere. Instead, I'm more interested in tracking only the files that actually get modified locally. For example, on a normal FreeBSD system, the wide majority of files in /etc are copied straight from the master FreeBSD CVS repository without any modification, so tracking those files is highly redundant. Furthermore, managing a few hundred generic files can bury your own interesting changes under a mountain of "diff"s. So, then, the following is a demonstration of how to put a certain directory under VersionControl? without using SubVersion?'s own import command to slurp in the whole thing.

For our examples, assume:

  • The hostname of the machine being managed is cmhost.
  • We're going to manage /etc.

Now, the process:

  • Create a /hosts subdirectory and entries for the hosts you want to manage:
# svn -m "Making CM subdirectories" mkdir file:///var/svn/hosts
# svn -m "Making CM subdirectories" mkdir file:///var/svn/hosts/cmhost
# svn -m "Making CM subdirectories" mkdir file:///var/svn/hosts/cmhost/etc
  • Now, the tricky part: replacing your precious /etc directory with a VersionControl?led copy. I use RsYnc? for this step, but any tool that can exactly replicate a directory tree is perfectly acceptable:
# cd /
# svn co file:///var/svn/hosts/web2/etc etc-svn
# rsync -av etc/ etc-svn/
# mv /etc /etc-old
# mv /etc-svn /etc
  • Verify that the only difference between the old and new directory copies is that the new one is under VersionControl?:
# diff -ur /etc-old /etc
Only in /etc: .svn

That's all there is to it. Now you can use the full suite of SubVersion? commands to add, rename, and annotate files.

-- KirkStrauser - 16 Feb 2004

META FORM ClassForm  
META FIELD TopicClassification TopicClassification SystemAdministration
META FIELD OsVersion OsVersion All
View topic | Diffs | r1.4 | > | r1.3 | > | r1.2 | More
Revision r1.1 - 16 Feb 2004 - 15:48 - KirkStrauser
Revision r1.4 - 17 May 2004 - 09:05 - TWikiGuest