Skip to content

Commit

Permalink
Merge pull request #2 from dmitriy-kiriyenko/1-tag-correct-commit-on-…
Browse files Browse the repository at this point in the history
…deployment

Closes #1. Tag correct commit on deployment.
  • Loading branch information
dmitriy-kiriyenko committed Apr 24, 2012
2 parents 2dc37c5 + e4cb5d6 commit ce92348
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/releaser/capistrano.rb
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/releaser/capistrano/release_tagging.rb
Expand Up @@ -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

Expand All @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions lib/releaser/cli.rb
Expand Up @@ -11,7 +11,8 @@ 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 :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

desc "major [CODENAME]", "Issue a major release"
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit ce92348

Please sign in to comment.