Skip to content

Commit c1de22b

Browse files
committed
AutoTagger should use the revision from the current deploy
1 parent 7f609c3 commit c1de22b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/auto_tagger.rake

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818

1919
STAGES = %w[ci staging production]
2020

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

3334
task :after_deploy do
3435
each_heroku_app do |stage|
35-
create_and_push(stage.name)
36+
create_and_push(stage.name, stage.revision)
3637
end
3738
Rake::Task['autotag:list'].invoke
3839
end
@@ -58,5 +59,4 @@ namespace :autotag do
5859
puts " ** %-12s %s" % [stage, log]
5960
end
6061
end
61-
end
6262
end

0 commit comments

Comments
 (0)