Skip to content

Instantly share code, notes, and snippets.

@asnaedae
Last active August 29, 2015 14:14
Show Gist options
  • Save asnaedae/8b139499d16d379754e1 to your computer and use it in GitHub Desktop.
Save asnaedae/8b139499d16d379754e1 to your computer and use it in GitHub Desktop.
capistrano changelog from git
after :finished, :changelog do
# generate changelog, as we know which revision is the end
on roles(:web) do
within release_path do
releases = capture(:ls, '-xt', releases_path).split
prev_release_id = capture(:cat, releases_path.join(releases[1]).join('REVISION'))
changelog = capture(:git, "--git-dir=#{repo_path}", '--no-pager', 'log', '--pretty=oneline', '--reverse', '--decorate', '--color', "#{prev_release_id}..#{fetch(:current_revision)}")
info "Changes between #{prev_release_id} and #{fetch(:current_revision)} releases"
info changelog
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment