It seems to me like the deeper issue is reusing the same cached copy for different deployment stages. I'm hesitant about adding the git clean, because even little tweaks to the SCM modules tend to have large (and largely hidden) side effects. I think I'd rather recommend that people set :copy_cache to a different directory for each staging environment.
- Jamis On 1/16/09 6:11 PM, Lee Hambley wrote: > Darrell, > > I'd argue this should be how it works by default, though I'm sure jamis > will have an opinion, you are more than welcome to make this change and > request he pulls from you, > > Can you imagine an implementation for Subversion, perhaps using merge? > > - Lee > > 2009/1/16 Darrell <[email protected] <mailto:[email protected]>> > > > > I've run into an issue with how the cached-copy is maintained. > > In a development branch we added a plugin as a git submodule, and that > was deployed to a test server. When we then went to re-deploy the > production branch to that same server, the submodule was still in the > cached copy, which led to it being copied out. As you might expect, > that broke the production version of the app. (This plugin also > depended on a gem being installed under vendor/gems, since was not a > sub-module, it did not appear in the production branch.) > > Anyway, long story short, there's an easy fix, which I submit for > inclusion. I would think this is not too dangerous as long as people > aren't depending on untracked files in your cached-copy (and why one > do that, I cannot imagine) > > Darrell > > --- > lib/capistrano/recipes/deploy/scm/git.rb | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/lib/capistrano/recipes/deploy/scm/git.rb b/lib/capistrano/ > recipes/deploy/scm/git.rb > index 63e2a28..0e7cef8 100644 > --- a/lib/capistrano/recipes/deploy/scm/git.rb > +++ b/lib/capistrano/recipes/deploy/scm/git.rb > @@ -185,6 +185,7 @@ module Capistrano > > # since we're in a local branch already, just reset to > specified revision rather than merge > execute << "#{git} fetch #{verbose} #{remote} && #{git} > reset #{verbose} --hard #{revision}" > + execute << "#{git} clean #{verbose} -d -x -f" > > if configuration[:git_enable_submodules] > execute << "#{git} submodule #{verbose} init" > -- > 1.5.5.1 > > > > > > > --~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
