Post Commit Update
Michael Andronov
michael_andronov at sd-kyber.com
Wed Sep 29 15:12:24 BST 2010
I was a bit in 'rush' to put my solution ( monitoring with inotify..).
The reason I went that way -- I did not see how hooks may work on the
server, if the user accessed bzr repository with sftp, for example.
(And I can not control which protocol the user can and can not use. )
But may be I missed something about the hooks...
During the last 4 months, the code is working fine, replicating the
code between different machines, doing some checking, etc.
If you find the solution for your challenge with the hooks, etc.
please, describe it briefly. I'm wondering to compare and evaluate a
new approach(es).
Michael.
On Wed, Sep 29, 2010 at 9:42 AM, Marius Boitor <boitor.marius at gmail.com> wrote:
> Thanks for all these.
>
> The idea is that I am in search for an idea or more ideas that can do the
> trick and I can rely on.
> I've got my own approach but I don't know if it's the best approach.
>
> I was thinking to use as John said hooks or at least this is what I've used
> with SVN in different places.
>
> Now is time for Bazaar because I have a blank sheet.This is the reason why I
> wanted to know if there is a better approach than hooks and if any how
> reliable is that approach.
>
> Again, thank you very much for all.
>
> Marius
>
> On Wed, Sep 29, 2010 at 4:10 AM, Michael Andronov
> <michael_andronov at sd-kyber.com> wrote:
>>
>> As John mentioned, there are 2 ways to access the bzr repository.
>> In my case, I was not able to control the way people preferred to
>> access the repositories.
>> So, I had to assume that people would access the repository directly.
>>
>> I found the solution by monitoring the .bzr/repository/lock by inotify
>> program.
>>
>> So, the script is maintained by cron, and the main part of it:
>> "
>> ...
>> while /usr/local/bin/inotifywait -e delete $srcR/.bzr/repository/lock
>> | grep 'DELETE,ISDIR releasing' &> /dev/null; do
>> # the actual work will be done...
>> su $bzrUser -c "$wrkDir/bzrPostCommit.py $cmdL "
>> done
>> ...
>> "
>> bzrUser -- the user, on which account the bzrPostCommit.sh will run;
>> cmdL -- inline parameters, if any;
>> $wrkDit/bzrPostCommit.py -- the path to & the post Commit script itself...
>> see 'man inotify' for details on inotify. (OSX has similar service via
>> launchd)
>>
>> I'm not saying that the above is a perfect solution.
>> But depending on what your goal is, the above may do the trick for
>> your project too.
>>
>> Michael.
>
>
>
> --
> With respect,
> Marius Boitor
>
> Website: http://www.devessence.com
> LinkedIn Profile: http://www.linkedin.com/in/mariusboitor
>
More information about the bazaar
mailing list