RUBY-421 fixes for rake reployment tasks

This commit is contained in:
Tyler Brock 2012-04-03 17:28:42 -04:00
parent e9e0e47cc1
commit ee83b6be2c
2 changed files with 34 additions and 22 deletions

View File

@ -188,7 +188,6 @@ namespace :jenkins do
end end
namespace :gem do namespace :gem do
desc "Install the gem locally" desc "Install the gem locally"
task :install do task :install do
`gem build bson.gemspec` `gem build bson.gemspec`
@ -212,17 +211,6 @@ namespace :gem do
`gem install --no-rdoc --no-ri bson_ext-*.gem` `gem install --no-rdoc --no-ri bson_ext-*.gem`
`rm bson_ext-*.gem` `rm bson_ext-*.gem`
end end
desc "Build all gems"
task :build_all do
`rm *.gem`
`gem build mongo.gemspec`
`gem build bson.gemspec`
`gem build bson.java.gemspec`
`gem build bson_ext.gemspec`
puts `ls *.gem`
end
end end
namespace :ci do namespace :ci do
@ -271,6 +259,7 @@ end
def change_version(new_version) def change_version(new_version)
version = current_version version = current_version
puts "Changing version from #{version} to #{new_version}"
VERSION_FILES.each do |filename| VERSION_FILES.each do |filename|
f = File.open(filename) f = File.open(filename)
str = f.read str = f.read
@ -283,30 +272,46 @@ def change_version(new_version)
end end
namespace :deploy do namespace :deploy do
task :version, [:version] do |t, args| desc "Change version to new release"
check_version(args[:version]) task :change_version, [:version] do |t, args|
puts args[:version] check_version(args[:version])
change_version(args[:version]) change_version(args[:version])
end end
task :git_prepare, [:version] do |t, args| desc "Add version files, commit, tag release"
task :git_prepare do |t, args|
g = Git.open(Dir.getwd()) g = Git.open(Dir.getwd())
version = args[:version] version = current_version
check_version(version)
g.add(VERSION_FILES) g.add(VERSION_FILES)
g.commit "RELEASE #{version}" g.commit "RELEASE #{version}"
g.add_tag("#{version}") g.add_tag("#{version}")
end end
desc "Push release to github"
task :git_push do task :git_push do
g = Git.open(Dir.getwd()) g = Git.open(Dir.getwd())
g.push g.push
end end
task :gems, [:version] do |t, args| desc "Build all gems"
check_version(args[:version]) task :gem_build do
check_gem_list_existence(args[:version]) `rm *.gem`
gem_list `gem build mongo.gemspec`
`gem build bson.gemspec`
`gem build bson.java.gemspec`
`gem build bson_ext.gemspec`
puts `ls *.gem`
end
desc "Push all gems to RubyGems"
task :gem_push do |t, args|
check_gem_list_existence(current_version)
gem_list.each do |gem|
puts "Push #{gem} to RubyGems? (y/N)"
if gets.chomp! == 'y'
system "gem push #{gem}"
end
end
end end
end end

View File

@ -45,3 +45,10 @@ Before each relese to Rubygems.org, the following steps will be taken:
11. Close out release in JIRA. 11. Close out release in JIRA.
12. Annouce release on mongodb-user and mongodb-dev. 12. Annouce release on mongodb-user and mongodb-dev.
## Rake Deploy Tasks
1. rake deploy:change_version[1.6.1]
2. rake deploy:git_prepare
3. rake deploy:git_push
4. rake deploy:gem_build
5. rake deploy:gem_push