From 6fc46085555453e5d848bc9438a9889fcb3d62f0 Mon Sep 17 00:00:00 2001 From: Dmitriy Kiriyenko Date: Tue, 24 Apr 2012 17:30:46 +0300 Subject: [PATCH 1/5] Forse the instance to exist. --- lib/releaser/capistrano.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/releaser/capistrano.rb b/lib/releaser/capistrano.rb index 5e1fac5..0f3dc94 100644 --- a/lib/releaser/capistrano.rb +++ b/lib/releaser/capistrano.rb @@ -2,7 +2,7 @@ abort "Soprano requires Capistrano 2" end -Capistrano::Configuration.instance.load do +Capistrano::Configuration.instance(:must_exist).load do Dir["#{File.dirname(__FILE__)}/capistrano/*.rb"].each do |recipe| load(recipe) end From 63137013212365433f5ba462dec3a3d899088e27 Mon Sep 17 00:00:00 2001 From: Dmitriy Kiriyenko Date: Tue, 24 Apr 2012 17:43:51 +0300 Subject: [PATCH 2/5] Add a description to push option. --- lib/releaser/cli.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/releaser/cli.rb b/lib/releaser/cli.rb index a9f5f20..9ac4e87 100644 --- a/lib/releaser/cli.rb +++ b/lib/releaser/cli.rb @@ -11,7 +11,7 @@ class CLI < ::Thor include Rails::Generators::Actions add_runtime_options! class_option :message, :type => :string, :aliases => "-m", :desc => "Specify a tag message (-m option for git tag)" - class_option :push, :type => :boolean, :default => true + class_option :push, :type => :boolean, :default => true, :desc => "Whether to push the commit (provide --no-push to override)" default_task :info desc "major [CODENAME]", "Issue a major release" From 2249f5f17f96916f4bb82dd40d742f402115f692 Mon Sep 17 00:00:00 2001 From: Dmitriy Kiriyenko Date: Tue, 24 Apr 2012 17:44:14 +0300 Subject: [PATCH 3/5] Add an optional object parameter. --- lib/releaser/cli.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/releaser/cli.rb b/lib/releaser/cli.rb index 9ac4e87..60fdf1b 100644 --- a/lib/releaser/cli.rb +++ b/lib/releaser/cli.rb @@ -11,6 +11,7 @@ class CLI < ::Thor include Rails::Generators::Actions add_runtime_options! class_option :message, :type => :string, :aliases => "-m", :desc => "Specify a tag message (-m option for git tag)" + class_option :object, :type => :string, :aliases => "-o", :desc => "Specify a tag object (which commit to tag with version)" class_option :push, :type => :boolean, :default => true, :desc => "Whether to push the commit (provide --no-push to override)" default_task :info @@ -66,7 +67,7 @@ def tag(tag, config = {}) opts.push "-f" if config[:force] end - run "git tag #{tag_options.join(" ")} -- #{tag}" + run "git tag #{tag_options.join(" ")} -- #{tag} #{options.object}" run "git push origin #{tag}" if options.push? end From 248e4c36034ad579d130efeecfe37f659f17b98d Mon Sep 17 00:00:00 2001 From: Dmitriy Kiriyenko Date: Tue, 24 Apr 2012 17:45:00 +0300 Subject: [PATCH 4/5] Use deploy:create_symlink hook instead of deprecated. --- lib/releaser/capistrano/release_tagging.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/releaser/capistrano/release_tagging.rb b/lib/releaser/capistrano/release_tagging.rb index d131eae..4494d56 100644 --- a/lib/releaser/capistrano/release_tagging.rb +++ b/lib/releaser/capistrano/release_tagging.rb @@ -16,7 +16,7 @@ end if fetch(:write_version, true) - after "deploy:symlink", "releaser:write_current" + after "deploy:create_symlink", "releaser:write_current" end if fetch(:tag_deploy_commit, true) From e4cb5d66ea53563acc039b90b26a4b9343a1c824 Mon Sep 17 00:00:00 2001 From: Dmitriy Kiriyenko Date: Tue, 24 Apr 2012 17:52:32 +0300 Subject: [PATCH 5/5] Use param in capistrano recipe. --- lib/releaser/capistrano/release_tagging.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/releaser/capistrano/release_tagging.rb b/lib/releaser/capistrano/release_tagging.rb index 4494d56..c1e5321 100644 --- a/lib/releaser/capistrano/release_tagging.rb +++ b/lib/releaser/capistrano/release_tagging.rb @@ -6,7 +6,7 @@ end task :tag_deploy_commit do - run_locally "bundle exec releaser deploy --push" + run_locally "bundle exec releaser deploy --push --object=#{branch}" end end