lib/heroku_release.rb in heroku_release-0.2.1 vs lib/heroku_release.rb in heroku_release-0.2.2
- old
+ new
@@ -34,20 +34,26 @@
def tag
release_name = get_release_name
quoted_tag_comment = single_quote(tag_comment)
+ if config.version_file_path || config.changelog_path
+ if config.version_file_path
+ output "Updating version file at #{config.version_file_path}"
+ update_version_file(release_name)
+ end
+ if config.changelog_path
+ output "Updating #{config.changelog_path}"
+ update_changelog
+ end
+ commit(release_name, quoted_tag_comment)
+ end
+
output "Tagging release as '#{release_name}'"
execute "git tag -a #{release_name} -m '#{quoted_tag_comment}'"
execute "git push --tags origin"
execute "git push --tags #{config.heroku_remote}"
-
- if config.version_file_path || config.changelog_path
- update_version_file(release_name) if config.version_file_path
- update_changelog if config.changelog_path
- commit(release_name, quoted_tag_comment)
- end
end
def log
output("\n" + changelog)
end
@@ -73,11 +79,11 @@
current = current_release_version
previous = previous_release_version
if previous
output "Rolling back to '#{previous}' ..."
execute "git push -f #{config.heroku_remote} #{previous}:master"
- output "Deleting rollbacked release '#{current}' ..."
+ output "Removing rolled back release tag '#{current}' ..."
remove_tag(current)
output 'Rollback completed'
else
output "No release tags found - cannot do rollback"
output releases
@@ -129,16 +135,14 @@
nil
end
end
def update_version_file(release_name)
- output "Committing version file for release #{release_name}"
File.open(config.version_file_path, "w") { |f| f.print release_name }
execute "git add #{config.version_file_path}"
end
def update_changelog
- output "Committing #{config.changelog_path}"
write_changelog
execute "git add #{config.changelog_path}"
end
def commit(release_name, quoted_tag_comment)