Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add git tasks to Rakefile

  • Loading branch information...
commit be124d5f714a6d50f0b0a88495c27ea47ab9b9d0 1 parent a83b0c6
@bschaeffer authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 Rakefile
View
24 Rakefile
@@ -17,6 +17,7 @@ namespace :ohm do
puts "-------------------#{'-'*project_version.length}"
Rake::Task['ohm:bump_version'].execute
Rake::Task['ohm:create_builds'].execute
+ Rake::Task['ohm:git_release_tasks'].invoke
end
def update_version(package, version)
@@ -52,4 +53,27 @@ namespace :ohm do
FileUtils.copy("dist/#{name}", "builds/#{name}", verbose: true)
end
end
+
+ task git_release_tasks: [:commit, :tag, :push]
+
+ task :commit do
+ sh('git reset')
+ sh('git add VERSION builds/ docs/yuidoc.json')
+ sh("git commit -m 'Version bump - #{project_version}'")
+ end
+
+ task :tag do
+ sh("git tag v#{project_version}")
+ end
+
+ task :push do
+ print "Are you sure you want to push the repo? (y/N) "
+ res = STDIN.gets.chomp
+ if res =~ /^y/i
+ sh('git push')
+ sh('git push --tags')
+ else
+ puts "=> Not pushing"
+ end
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.