Created — forked from tjhanley/deploy.rb

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Capistrano task for creating a change log file

View deploy.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
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.