Skip to content

Commit e456712

Browse files
committed
RUBY-1681 Enforce that private key exists prior to releasing
1 parent 0946131 commit e456712

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Rakefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Bundler.require(*default_groups)
1515

1616
require 'rspec/core/rake_task'
1717

18+
tasks = Rake.application.instance_variable_get('@tasks')
19+
tasks['release:do'] = tasks.delete('release')
20+
1821
RSpec::Core::RakeTask.new(:spec) do |t|
1922
#t.rspec_opts = "--profile 5" if ENV['CI']
2023
end
@@ -32,7 +35,17 @@ namespace :spec do
3235
task :ci => ['spec:prepare', :spec]
3336
end
3437

35-
task :release => :spec do
38+
namespace :release do
39+
task :check_private_key do
40+
unless File.exists?('gem-private_key.pem')
41+
raise "No private key present, cannot release"
42+
end
43+
end
44+
end
45+
46+
task :release => ['release:check_private_key', 'release:do'] do
47+
puts "Releasing #{Mongo::VERSION}"
48+
3649
system "git tag -a #{Mongo::VERSION} -m 'Tagging release: #{Mongo::VERSION}'"
3750
system "git push --tags"
3851
system "gem build mongo.gemspec"

0 commit comments

Comments
 (0)