monotone-users
[Top][All Lists]
Advanced

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

[Monotone-users] Monotone scripting question


From: Judson Lester
Subject: [Monotone-users] Monotone scripting question
Date: Fri, 3 Jun 2011 13:26:57 -0700

Is there anything already existent that can be used to run tasks in Monotone?

I ask because I've found several times that I want to do things with Monotone that wind up locking on the database and need to be spawned off and then *that* causes it's own issues, etc etc.

What I have in mind to build is a registered command that inspects the database variables in a "tasks" domains, and then attempts to run those tasks, which would be defined most likely as lua scripts in a tasks directory inside of hooks.d or something.  

As an example use case, synchronizing databases:

- in note_netsync_revision_received, do something like "mtn set tasks <unique_id> "sync_dbs remote_db_name branch.to.sync"
- in note_netsync_end, spawn "mtn run_tasks"
run_tasks fires up, loads tasks.d/*.lua, "list var tasks", matches task names against task values, and runs them with arguments.  In this case: sync_dbs("remote_db_name", "branch.to.sync") which would look up the remote db in it's own table of dbs, and start a sync of branch.

Specific use cases I have in mind: 

I use a central DB on my dev box and had been using a central DB on my mtn server - I've been switching to usher/indefero, and would like to be able to still just "mtn sync" in whatever project.  Maybe the right solution is to split out into single dbs as each project makes its way to IDF, but amongst other things I like to be able to do mass propagates, since these projects have a fair amount in common.  So, I'd like to still sync from central db to central db, and have the rc on the server sync the main db to the project db,  and vice versa.

I would really like to be able to maintain an offsite backup, ideally one that syncs with every push, pretty much likewise.

I have a set of branches that represent static websites - in the past I've had them set up to republish the files when the branch was committed.  The solution I set up wound up being very fragile, but this seems like it could be more durable.  Likewise, it seems like it might make a nice basis for a deployment solution for full fledged web apps.

Judson

reply via email to

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