Module: Capistrano::Git::SubmoduleStrategy

Includes:
DefaultStrategy
Defined in:
lib/capistrano/capistrano-git-submodule-strategy.rb

Instance Method Summary collapse

Instance Method Details

#checkObject



12
13
14
# File 'lib/capistrano/capistrano-git-submodule-strategy.rb', line 12

def check
  test! :git, :'ls-remote', repo_url
end

#cloneObject



16
17
18
# File 'lib/capistrano/capistrano-git-submodule-strategy.rb', line 16

def clone
  git :clone, '-b', fetch(:branch), '--recursive', repo_url, repo_path
end

#releaseObject

put the working tree in a release-branch, make sure the submodules are up-to-date and copy everything to the release path



27
28
29
30
31
# File 'lib/capistrano/capistrano-git-submodule-strategy.rb', line 27

def release
  git :checkout, fetch(:branch)
  git :submodule, :update, '--init', '--recursive'
  context.execute "rsync -ar --exclude=.git\* #{repo_path}/ #{release_path}"
end

#testObject



8
9
10
# File 'lib/capistrano/capistrano-git-submodule-strategy.rb', line 8

def test
  test! " [ -d #{repo_path}/.git ] "
end

#updateObject



20
21
22
# File 'lib/capistrano/capistrano-git-submodule-strategy.rb', line 20

def update
  git :remote, :update
end