Deploying VCS-controlled files to home directory
Michael Stillwell
mjs at beebo.org
Mon Jun 30 11:43:56 CEST 2008
On Sun, Jun 22, 2008 at 11:15 AM, Ben Finney <ben at benfinney.id.au> wrote:
> My question is: What strategy would you advise to automate deployment
> of this to a new machine, and to deploy updates on existing machines
> when it changes in the VCS?
I don't have host-specific application config files, but I do have
host-specific config files for bash.
I manage this via cascading through increasingly specific generic
configuration files, OS configuration files and finally host
configuration files:
sourceif "$CONFIG/$OS/config"
sourceif "$CONFIG/$OS/$PLATFORM/config"
sourceif "$CONFIG/$OS/$PLATFORM/$HOSTNAME/config"
(I have a similar cascade for setting the path.)
sourceif sources the file if it exists, and is merely:
function sourceif {
if [ -f "$1" ]; then
source "$1"
fi
}
The other environment variables are as follows:
export CONFIG="$HOME/.config"
export OS='unix'
export PLATFORM=`"$HOME/.platform"`
export HOSTNAME=`hostname | tr '.' ' ' | awk '{ print $1 }'`
($HOME/.platform is essentially `uname -s`, regularised a little.)
I thought this was going to be too simplistic when I set it up about
10 years ago, and that I'd have to implement something more
sophisticated at some point, but it's survived a whole heap of systems
without major change. The tree currently looks like this:
unix/alpha
unix/cygwin/clem
unix/cygwin
unix/darwin/boom
unix/darwin/hector
unix/darwin/mop
unix/darwin
unix/decstation
unix/freebsd/bruce
unix/freebsd/saga
unix/freebsd
unix/linux/bund
unix/linux/catalina
unix/linux/mel
unix/linux/normand
unix/linux/rag
unix/linux
unix/osf
unix/sgi
unix/sunos/cms
unix/sunos/jumbo
unix/sunos/sng
unix/sunos
unix
My application-specific configuration files are in ~/.config/home, and
are symlinked into the root.
Cheers,
Michael
--
http://beebo.org
More information about the vcs-home
mailing list