[rex-users] Re: SCM questions

  • From: Jan Gehring <jan.gehring@xxxxxxxxx>
  • To: rex-users@xxxxxxxxxxxxx
  • Date: Mon, 27 Jun 2011 11:51:45 +0200

Hi Franky,

On Mon, Jun 27, 2011 at 10:08 AM, Franky Van Liedekerke
<franky@xxxxxxxxxxxxx> wrote:

> tried it out, and it seems (following the example presented here:
> https://github.com/krimdomu/rex-scm) that the checkout happens on
> every target machine and then via rsync the file gets placed in the
> correct dir. I was under the impression that the checkout would happen
> only on the rex master server?

Yes, this example has a mistake.

You can split the checkout and the sync in 2 tasks.


task "checkout", sub {
    checkout 'static', branch => 'stable';

task "sync", group => "servers", sub {
    sync 'static/*', '/var/www/html';

task "deploy", sub {
    do_task [ qw/checkout sync/ ];

And call it with: rex deploy

Or you can put the checkout in a LOCAL { } block.
Everything in a LOCAL block will be executed on the host where rex is
running, regardless of what is defined in the task or by the cli
parameter "-H".

task "deploy", group => "servers", sub {

    LOCAL {
         checkout 'static', branch => 'stable';

    sync ...

The SCM Module is a module i wrote for a project. So there are not
many options right now. But this will be one of the next modules to

> Btw: an extra option to checkout with a given username/password would
> be very nice!

This is definitely a feature i will implement.


Other related posts: