Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Capistrano task for creating a change log file
desc "Create about and revision files."
task :rev_deployment, :roles => [:app, :web] do
require 'grit'
require 'chronic'
# include Grit
work_dir = File.join(File.dirname(__FILE__), '../../')
g = Grit::Repo.new(work_dir)
since = Chronic.parse('last week friday')
msg = "\n"
rev_file = File.join(File.dirname(__FILE__), '../../','tmp/revision.txt')
File.new(rev_file,"w+") unless File.exists?(rev_file)
File.open(rev_file,"w") do |f|
f.puts "Version Info"
f.puts "================================================="
f.puts "Version: #{real_revision}"
f.puts "Deploy Date: #{Time.now}"
f.puts "Branch: #{exists?(:branch) ? branch : 'local'}"
if ENV != 'production'
f.puts "Changes: Last #{since}"
f.puts "================================================="
g.commits_since(branch,since).each do |commit|
# commit = g.gcommit(c)
f.puts "[#{commit.committed_date.strftime("%m-%d-%y %I:%M%p")}] #{commit.committer} - #{commit.committer.email}"
f.puts "#{commit.message}"
f.puts ""
end
end
end
upload(rev_file,"#{release_path}/public/revision.txt")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.