monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Re: FAQ on wiki


From: Matthew A. Nicholson
Subject: Re: [Monotone-devel] Re: FAQ on wiki
Date: Thu, 13 Jul 2006 10:14:42 -0500
User-agent: Thunderbird 1.5.0.4 (X11/20060619)

Richard Levitte - VMS Whacker wrote:
In message <address@hidden> on Thu, 13 Jul 2006 01:03:04 -0700, Nathaniel Smith 
<address@hidden> 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='address@hidden' \
        --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 \
    address@hidden

Create /var/lib/mtn-PROJECTNAME/conf/monotonerc with the following as
a template:

-------------------- snip --------------------
function get_passphrase (keypair_id)
  if (keypair_id == "address@hidden")
  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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]