Neat stuff! Thanks for sharing.

- Jamis

On 9/20/07, haakon <[EMAIL PROTECTED]> wrote:
>
> I thought I would post a deployment recipe that I have found handy.  I
> wanted an automated log of when deployments were made and what they
> included.  So, I created a task which prepends the change messages
> from svn to a deployment log, and commits it.  Here it is:
>
> before 'deploy:update_code', 'deploy:annotate_changelog'
> namespace :deploy do
>
>   task :annotate_changelog do
>      cmd = source.local.log(current_revision)
>      result = `#{cmd}`
>
>      filename = "doc/#{stage}_changelog.txt"
>
>      old_contents = File.read(filename)
>
>      # append results to changelog file
>      open(filename, 'w') do |file|
>        file.puts "CHANGELOG for deploy occuring at '#{Time.now}' by
> #{ENV['USER']}"
>        file.puts result
>        file.puts "\n\n"
>        file.puts old_contents
>      end
>
>      # commit the changelog to svn
>      system "svn commit -m 'updated deploy changelog for #{stage}'
> #{filename}"
>   end
> end
>
> I wrote the file out to the "doc" directory and then created an action
> which served up the file.  I did this because I only allow "admin"
> people to view the changelog.  Otherwise, you could just write the
> file out to the "public" dir and it would be even easier.
>
> Anyway, this little recipe did what I wanted to do so I thought I
> would share it.
>
> cheers,
> Haakon
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to