Sha256: ff5829385f4a7abb2a0666f5f402f2cb1584ae33162f9e5bbd2979c01ed09118

Contents?: true

Size: 808 Bytes

Versions: 2

Compression:

Stored size: 808 Bytes

Contents

require 'capistrano/git'

class Capistrano::Git
  module SubmoduleStrategy
    # do all the things a normal capistrano git session would do
    include Capistrano::Git::DefaultStrategy

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

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

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

    def update
      git :remote, :update
    end

    # put the working tree in a release-branch,
    # make sure the submodules are up-to-date
    # and copy everything to the release path
    def release
      git :checkout, fetch(:branch)
      git :submodule, :update, '--init', '--recursive'
      context.execute "rsync -ar --exclude=.git\* #{repo_path}/ #{release_path}"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capistrano-git-submodule-strategy-0.1.1 lib/capistrano/git-submodule-strategy.rb
capistrano-git-submodule-strategy-0.1.0 lib/capistrano/capistrano-git-submodule-strategy.rb