Richard Levitte - VMS Whacker wrote:
In message <[EMAIL PROTECTED]> on Thu, 13 Jul 2006 01:03:04 -0700, Nathaniel Smith
<[EMAIL PROTECTED]> said:
njs> On Thu, Jul 13, 2006 at 09:47:57AM +0200, Richard Levitte - VMS Whacker
wrote:
njs> > Do you want it done by crontab or through note_netsync_end()?
njs>
njs> Crontab, I'd think, or even a 'while sleep 600; ...' script run under
njs> daemontools supervision :-). (This is how the CIA script works now,
njs> to avoid crontab obnoxiousness.) Rather not couple the server and
njs> website that closely...
OK, here's what I use for some of my sites (it's a template, just
replace PROJECTNAME, SERVERNAME and BRANCHNAME with sensible strings
and change the paths that bother you):
-------------------- snip --------------------
#! /bin/sh
NAME=PROJECTNAME
SERVER=SERVERNAME
BRANCH=BRANCHNAME
CURRENTHOST=`hostname`
STORE=/var/lib/mtn-$NAME
WWWDIR=/var/www/$NAME
set -x
mkdir /var/run/$NAME.mtnlock && \
( /usr/bin/mtn \
--db=$STORE/mtn-mirror \
--keydir=$STORE/keys \
--rcfile=$STORE/conf/monotonerc \
--key='[EMAIL PROTECTED]' \
--ticker=dot \
pull $SERVER '$BRANCH*'
( cd $WWWDIR; /usr/bin/mtn update; if [ -f Makefile ]; then make; fi )
rmdir /var/run/$NAME.mtnlock )
-------------------- snip --------------------
You have to initiate once with the following (uhmmm, from memory):
mkdir /var/lib/mtn-PROJECTNAME
mkdir /var/lib/mtn-PROJECTNAME/keys
mkdir /var/lib/mtn-PROJECTNAME/conf
/usr/bin/mtn db init --db=/var/lib/mtn-PROJECTNAME/mtn-mirror
/usr/bin/mtn genkey \
--db=/var/lib/mtn-PROJECTNAME/mtn-mirror \
--keydir=/var/lib/mtn-PROJECTNAME/keys \
[EMAIL PROTECTED]
Create /var/lib/mtn-PROJECTNAME/conf/monotonerc with the following as
a template:
-------------------- snip --------------------
function get_passphrase (keypair_id)
if (keypair_id == "[EMAIL PROTECTED]")
then
return "PASSWORD"
end
return false
end
-------------------- snip --------------------
That should cover it, IIRC. Note that I created that templace script
*after* I set up my last site pump, based on the script I made for
that pump, so it's untested.
Cheers,
Richard
The debian package from the n.v.m.debian branch also contains something
like this.
--
Matthew A. Nicholson
matt-land.com
_______________________________________________
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel