-
-
Save tomconroy/09010bab4e76477ef306 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # this include won't work for some reason: | |
| # include Capistrano::Git::DefaultStrategy | |
| module SubmoduleStrategy | |
| # check for a .git directory | |
| def test | |
| test! " [ -d #{repo_path}/.git ] " | |
| end | |
| # same as in Capistrano::Git::DefaultStrategy | |
| def check | |
| test! :git, :'ls-remote', repo_url | |
| end | |
| def clone | |
| git :clone, '-b', fetch(:branch), '--recursive', repo_url, repo_path | |
| end | |
| # same as in Capistrano::Git::DefaultStrategy | |
| def update | |
| git :remote, :update | |
| end | |
| # rsync the working tree to the release path | |
| def release | |
| git :checkout, fetch(:branch) | |
| git :submodule, :update, '--init' | |
| context.execute "rsync -ar --exclude=.git\* #{repo_path}/ #{release_path}" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment