Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8755

Show
Ignore:
Timestamp:
01/30/08 06:21:49 (6 months ago)
Author:
minam
Message:

Add support for :git_enable_submodules variable, to enable submodules with git SCM (closes #10240)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/capistrano/CHANGELOG

    r8754 r8755  
    11*SVN* 
     2 
     3* Add support for :git_enable_submodules variable, to enable submodules with the git SCM [halorgium] 
    24 
    35* If subversion asks for a password, prompt as a last resort [Jamis Buck] 
  • tools/capistrano/lib/capistrano/recipes/deploy/scm/git.rb

    r7695 r8755  
    112112          fail "No branch specified, use for example 'set :branch, \"origin/master\"' in your deploy.rb" unless branch 
    113113 
     114          execute = [] 
    114115          if depth = configuration[:git_shallow_clone] 
    115             execute  = "#{git} clone --depth #{depth} #{configuration[:repository]} #{destination} &&
     116            execute  << "#{git} clone --depth #{depth} #{configuration[:repository]} #{destination}
    116117          else 
    117             execute  = "#{git} clone #{configuration[:repository]} #{destination} && " 
    118           end 
    119  
    120           execute += "cd #{destination} && #{git} checkout -b deploy #{branch}"  
    121  
    122           execute 
     118            execute  << "#{git} clone #{configuration[:repository]} #{destination}" 
     119          end 
     120 
     121          execute << "cd #{destination}" 
     122          execute << "#{git} checkout -b deploy #{branch}"  
     123          if configuration[:git_enable_submodules] 
     124            execute << "#{git} submodule init"  
     125            execute << "#{git} submodule update"  
     126          end 
     127 
     128          execute.join(" && ") 
    123129        end 
    124130 
     
    126132        # deployment strategy 
    127133        def sync(revision, destination) 
    128           execute = "cd #{destination} && git fetch origin && " 
     134          git      = command 
     135          execute = [] 
     136          execute << "cd #{destination} && #{git} fetch origin" 
    129137 
    130138          if head == 'HEAD' 
    131             execute += "git merge origin/HEAD" 
     139            execute << "#{git} merge origin/HEAD" 
    132140          else 
    133             execute += "git merge #{head}" 
    134           end 
    135  
    136           execute 
     141            execute << "#{git} merge #{head}" 
     142          end 
     143           
     144          if configuration[:git_enable_submodules] 
     145            execute << "#{git} submodule update" 
     146          end 
     147 
     148          execute.join(" && ") 
    137149        end 
    138150