I confirmed, using a bash shell, that the git command "git submodule -
q update" returns a non-zero return code when it encounters a network
error.

It looks like the return code from the system command to execute the
shell command to copy the source code locally was not checked.

I created a lighthouse ticket (http://capistrano.lighthouseapp.com/
projects/8716-capistrano/tickets/151-patch-rollback-if-shell-command-
to-copy-source-code-locally-returns-an-error) with a small patch to
add the check.

David King

On Feb 19, 2:58 pm, Lee Hambley <[email protected]> wrote:
> Must be a behavior of git to return status OK if submodules fail, can you
> try the command logging the return codes?
>
> You have to do it in bash, by hand i'm afraid!
>
> -- Lee Hambley
>
> Twitter: @leehambley | @capistranorb
> Blog:http://lee.hambley.name/
> Working with Rails:http://is.gd/1s5W1
>
> On 16 February 2010 22:04, David King <[email protected]> wrote:
>
> > During the update_code task, we'll sometimes encounter network errors
> > when executing a git command (e.g. git submodule -q update). Instead
> > of detecting the failure and rolling back the transaction, Capistrano
> > continues and deploys with missing code.
>
> > For example (config. details at end of post):
> >  ** transaction: start
> >  * executing `deploy:update_code'
> >  * preparing local cache at ...
> >    executing locally: "git ls-remote .git iframe"
> >    executing locally: git clone -q .git <path> && cd <path> && git
> > checkout -q -b deploy <version> && git submodule -q init && git
> > submodule -q sync && git submodule -q update
> > Initialized empty Git repository in ...
> > fatal: The remote end hung up unexpectedly
> > Clone of 'git://github.com/thoughtbot/paperclip.git' into submodule
> > path 'vendor/plugins/paperclip' failed
> >  * copying cache to deployment staging area ...
>
> > In capistrano / lib / capistrano / recipes / deploy / strategy /
> > copy.rb (http://github.com/capistrano/capistrano/blob/master/lib/
> > capistrano/recipes/deploy/strategy/copy.rb<http://github.com/capistrano/capistrano/blob/master/lib/%0Acapistrano...>),
> > it looks like Ruby's
> > Kernel module system method is called, but the return code is not
> > checked to trigger a rollback if false.
>
> > Is this a bug that I should file a ticket on or am I'm missing
> > something? Thanks for your help.
>
> > Dave
>
> > Git Version: 1.5.4.3
> > Ruby Version: 1.8.6
> > deploy.rb:
> >  set :repository,    ".git"
> >  set :scm,           :git
> >  set :deploy_via,    :copy
> >  set :copy_cache,    true
> >  set :copy_strategy, :export
> >  set :use_sudo,      false
> >  set :branch,        "master"
> >  set :copy_exclude,  [".git", "*/.gitignore", ".gitignore"]
> >  set :git_enable_submodules, 1
>
> > --
> > * You received this message because you are subscribed to the Google Groups
> > "Capistrano" group.
> > * To post to this group, send email to [email protected]
> > * To unsubscribe from this group, send email to
> > [email protected]<capistrano%[email protected]>For
> >  more options, visit this group at
> >http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to