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
namespace :gem do
desc "Install the gem locally"
task :install do
`gem build bson.gemspec`
@ -212,17 +211,6 @@ namespace :gem do
`gem install --no-rdoc --no-ri bson_ext-*.gem`
`rm bson_ext-*.gem`
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
namespace :ci do
@ -271,6 +259,7 @@ end
def change_version(new_version)
version = current_version
puts "Changing version from #{version} to #{new_version}"
VERSION_FILES.each do |filename|
f = File.open(filename)
str = f.read
@ -283,30 +272,46 @@ def change_version(new_version)
end
namespace :deploy do
task :version, [:version] do |t, args|
check_version(args[:version])
puts args[:version]
desc "Change version to new release"
task :change_version, [:version] do |t, args|
check_version(args[:version])
change_version(args[:version])
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())
version = args[:version]
check_version(version)
version = current_version
g.add(VERSION_FILES)
g.commit "RELEASE #{version}"
g.add_tag("#{version}")
end
desc "Push release to github"
task :git_push do
g = Git.open(Dir.getwd())
g.push
end
task :gems, [:version] do |t, args|
check_version(args[:version])
check_gem_list_existence(args[:version])
gem_list
desc "Build all gems"
task :gem_build 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
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

View File

@ -45,3 +45,10 @@ Before each relese to Rubygems.org, the following steps will be taken:
11. Close out release in JIRA.
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