Skip to content

Commit

Permalink
AutoTagger should use the revision from the current deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
kmayer committed Feb 12, 2013
1 parent 7f609c3 commit c1de22b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/auto_tagger.rake
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@


STAGES = %w[ci staging production] STAGES = %w[ci staging production]


def create_and_push(stage) def create_and_push(stage, revision = nil)
auto_tag = AutoTagger::Base.new(stages: STAGES, stage: stage, verbose: true, push_refs: false, refs_to_keep: 100) auto_tag = AutoTagger::Base.new(stages: STAGES, stage: stage, verbose: true, push_refs: false, refs_to_keep: 100)
tag = auto_tag.create_ref(auto_tag.last_ref_from_previous_stage.try(:sha)) sha = revision || auto_tag.last_ref_from_previous_stage.try(:sha)
tag = auto_tag.create_ref(sha)
sh "git push origin #{tag.name}" sh "git push origin #{tag.name}"
auto_tag.delete_locally auto_tag.delete_locally
auto_tag.delete_on_remote auto_tag.delete_on_remote
Expand All @@ -32,7 +33,7 @@ end


task :after_deploy do task :after_deploy do
each_heroku_app do |stage| each_heroku_app do |stage|
create_and_push(stage.name) create_and_push(stage.name, stage.revision)
end end
Rake::Task['autotag:list'].invoke Rake::Task['autotag:list'].invoke
end end
Expand All @@ -58,5 +59,4 @@ namespace :autotag do
puts " ** %-12s %s" % [stage, log] puts " ** %-12s %s" % [stage, log]
end end
end end
end
end end

0 comments on commit c1de22b

Please sign in to comment.