Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lib/capistrano/rsync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,20 @@

namespace :rsync do
task :hook_scm do
Rake::Task["#{scm}:check"].clear
Rake::Task.define_task("#{scm}:check") do
invoke "rsync:check"
end

Rake::Task["#{scm}:create_release"].clear
Rake::Task.define_task("#{scm}:create_release") do
invoke "rsync:release"
end

Rake::Task["#{scm}:set_current_revision"].clear
Rake::Task.define_task("#{scm}:set_current_revision") do
# :current_revision was already set during checkout
end
end

task :check do
Expand All @@ -74,6 +81,16 @@
end
end

desc "Set current revision into capistrano variable"
task :set_current_revision do
Dir.chdir fetch(:rsync_stage) do
get_current_revision = %x[git rev-parse HEAD]
set(:current_revision, get_current_revision)
end
end

after :stage, :set_current_revision

desc "Copy the code to the releases directory."
task :release => %w[rsync] do
# Skip copying if we've already synced straight to the release directory.
Expand Down
2 changes: 1 addition & 1 deletion lib/capistrano/rsync/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Capistrano
module Rsync
VERSION = "1.0.2"
VERSION = "1.0.2a"
end
end