Add SCM specific capabilities to get release log
This commit is contained in:
parent
11d7ce7a10
commit
bb578c17d2
@ -1,3 +1 @@
|
||||
require 'capistrano/send/mail'
|
||||
require 'capistrano/send/libnotify'
|
||||
require 'capistrano/send/notify-send'
|
||||
load File.expand_path('../tasks/send.cap', __FILE__)
|
||||
|
3
lib/capistrano/send/all.rb
Normal file
3
lib/capistrano/send/all.rb
Normal file
@ -0,0 +1,3 @@
|
||||
require 'capistrano/send/mail'
|
||||
require 'capistrano/send/libnotify'
|
||||
require 'capistrano/send/notify-send'
|
13
lib/capistrano/send/git.rb
Normal file
13
lib/capistrano/send/git.rb
Normal file
@ -0,0 +1,13 @@
|
||||
load File.expand_path('../../tasks/git.cap', __FILE__)
|
||||
|
||||
module Capistrano
|
||||
module Send
|
||||
module Git
|
||||
def log
|
||||
context.capture(:git, "--no-pager log --pretty=format:'* %s (%cn)' #{fetch(:previous_revision)}..#{fetch(:current_revision)}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Capistrano::Git.include Capistrano::Send::Git
|
13
lib/capistrano/send/hg.rb
Normal file
13
lib/capistrano/send/hg.rb
Normal file
@ -0,0 +1,13 @@
|
||||
load File.expand_path('../../tasks/hg.cap', __FILE__)
|
||||
|
||||
module Capistrano
|
||||
module Send
|
||||
module Hg
|
||||
def log
|
||||
context.capture(:hg, "log --template '{desc} ({author})\n' --rev #{fetch(:previous_revision)}..#{fetch(:current_revision)}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Capistrano::Hg.include Capistrano::Send::Hg
|
13
lib/capistrano/tasks/git.cap
Normal file
13
lib/capistrano/tasks/git.cap
Normal file
@ -0,0 +1,13 @@
|
||||
namespace :send do
|
||||
namespace :git do
|
||||
task :set_release_log do
|
||||
on release_roles :all do
|
||||
within repo_path do
|
||||
with fetch(:git_environmental_variables) do
|
||||
set :release_log, strategy.log
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
11
lib/capistrano/tasks/hg.cap
Normal file
11
lib/capistrano/tasks/hg.cap
Normal file
@ -0,0 +1,11 @@
|
||||
namespace :send do
|
||||
namespace :hg do
|
||||
task :set_release_log do
|
||||
on release_roles :all do
|
||||
within repo_path do
|
||||
set :release_log, strategy.log
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
13
lib/capistrano/tasks/send.cap
Normal file
13
lib/capistrano/tasks/send.cap
Normal file
@ -0,0 +1,13 @@
|
||||
namespace :send do
|
||||
task :set_release_log do
|
||||
invoke "send:#{scm}:set_release_log"
|
||||
end
|
||||
|
||||
task :load_scm do
|
||||
load "capistrano/send/#{fetch(:scm)}.rb"
|
||||
end
|
||||
end
|
||||
|
||||
Capistrano::DSL.stages.each do |stage|
|
||||
after stage, 'send:load_scm'
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user