Created
January 23, 2015 01:53
-
-
Save chulkilee/99c02e46773533f9f04f to your computer and use it in GitHub Desktop.
capistrano deploy:check for local git repo
This file contains 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
namespace :deploy do | |
namespace :git do | |
before :check, :local_repo do | |
on release_roles :all do | |
unless test "[ -d #{fetch(:local_repo_path)} ]" | |
execute :mkdir, '-p', fetch(:local_repo_path) | |
execute :git, "init --bare #{fetch(:local_repo_path)}" | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment