capistrano-rsync icon indicating copy to clipboard operation
capistrano-rsync copied to clipboard

capistano 3.2.x error - #{scm}:set_current_revision ?

Open irobayna opened this issue 11 years ago • 1 comments

It appears something has changed in latest capistrano and now it requires #{scm}:set_current_revision

I have forked the code and added the following definition


    Rake::Task.define_task("#{scm}:set_current_revision") do
      invoke "rsync:current_revision" 
    end

but not sure how to implement

so far I have this, but the system is not deploying the proper files (Ubuntu 14.04)

  task :current_revision => %w[set_current_revision]

Any thoughts?

irobayna avatar Apr 19 '14 13:04 irobayna

Try adding this somewhere your deploy.rb. It uses the same mechanism to figure out the git-revision than Capistrano 2 did. You don't need to fork this capistrano-rsync for this "intermediate patch" to work.

 namespace :rsync do

  # internally needed by capistrano's "deploy.rake"
  task :set_current_revision do
    run_locally do
      within fetch(:rsync_stage) do
        rev = capture(:git, 'rev-parse', 'HEAD')
        set :current_revision, rev
      end
    end
  end

gr8bit avatar May 07 '14 15:05 gr8bit