Skip to content

Instantly share code, notes, and snippets.

@chulkilee
Created January 23, 2015 01:53
Show Gist options
  • Save chulkilee/99c02e46773533f9f04f to your computer and use it in GitHub Desktop.
Save chulkilee/99c02e46773533f9f04f to your computer and use it in GitHub Desktop.
capistrano deploy:check for local git repo
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