Skip to content

Instantly share code, notes, and snippets.

@rsutphin
Created February 17, 2014 16:16
Show Gist options
  • Save rsutphin/9053606 to your computer and use it in GitHub Desktop.
Save rsutphin/9053606 to your computer and use it in GitHub Desktop.
Generates a cap2-like REVISION file when using cap3
require 'capistrano/git'
namespace :git do
after :create_release, :write_revision do
on roles :all do
with fetch(:git_environmental_variables) do
within repo_path do
execute :git, :log, '-1', '--format=%H', '>', release_path.join('REVISION')
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment