Capistrano default deploy module only requires that the releases sort correctly--in other words, sorted alphabetically, the last item in the list should be the most recently deployed version, and item[-2] should be the next-to-last, and so forth, back to item[0], which should be the oldest deployed release.

As long as you retain those semantics, you can rename the release directories however you want. If, however, you break those semantics, you'll lose the ability to reliably rollback to a previous release. Also, deploy:cleanup might destroy your currently released version.

- Jamis

On Feb 13, 2008, at 9:56 AM, Student wrote:


I've already put the following code in my deploy.rb file:

set :base_repository, BASE_REPO_URI
unless variables[:tag] or variables[:branch]
        if Dir.getwd =~ /(branche|tag)s\/([^\/]+)/
                variables[{'branche' => :branch, 'tag' => :tag}[$1]] = $2
        end
end

if variables[:tag]
 set :repository, "#{base_repository}/tags/#{variables[:tag]}"
elsif variables[:branch]
 set :repository, "#{base_repository}/branches/#{variables[:branch]}"
else
 set :repository, "#{base_repository}/trunk"
end

I would like a bit more, however--say something like:
def set_grokable_release(release)
 _cset(:release_name) { set :deploy_timestamped, true;
Time.now.utc.strftime("%Y%m%d%H%M%S-#{release}")}
end

if variables[:tag]
 set :repository, "#{base_repository}/tags/#{variables[:tag]}"
 set_grokable_release("tag-#{variables[:tag]}")
elsif variables[:branch]
 set :repository, "#{base_repository}/branches/#{variables[:branch]}"
 set_grokable_release("branch-#{variables[:branch]}-
#{variables[:revision]}")
else
 set :repository, "#{base_repository}/trunk"
 set_grokable_release("trunk-#{variables[:revision]}")
end

Is extending the name of the releases likely to cause trouble?  Is
this path worth pursuing at all?
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to