Skip to content

Commit 1190400

Browse files
committed
NET_SSH_NOKEY to allow to build without cert
1 parent ec31287 commit 1190400

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Rakefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,14 @@ begin
3131

3232
s.license = "MIT"
3333

34-
s.signing_key = File.join('/mnt/gem/', 'gem-private_key.pem')
35-
s.cert_chain = ['gem-public_cert.pem']
34+
unless ENV['NET_SSH_NOKEY']
35+
signing_key = File.join('/mnt/gem/', 'net-ssh-private_key.pem')
36+
s.signing_key = signing_key
37+
s.cert_chain = ['gem-public_cert.pem']
38+
unless (Rake.application.top_level_tasks & ['build','install']).empty?
39+
raise "No key found at #{signing_key} for signing, use rake <taskname> NET_SSH_NOKEY=1 to build without key" unless File.exist?(signing_key)
40+
end
41+
end
3642
end
3743
Jeweler::GemcutterTasks.new
3844
rescue LoadError

0 commit comments

Comments
 (0)