aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/pull.rb
diff options
context:
space:
mode:
authorMike McQuaid2015-02-18 12:56:10 +0000
committerMike McQuaid2015-02-18 13:07:22 +0000
commit675991eb611af0a970dce6945f5b882c4343875f (patch)
tree6a7fc60ac7c2ff848bc8f4d76a5263cedcd98d77 /Library/Homebrew/cmd/pull.rb
parente9e2be94040b103c5d5cf45755d487294120a0ab (diff)
downloadbrew-675991eb611af0a970dce6945f5b882c4343875f.tar.bz2
pull: publish bottles on Bintray.
Diffstat (limited to 'Library/Homebrew/cmd/pull.rb')
-rw-r--r--Library/Homebrew/cmd/pull.rb22
1 files changed, 19 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/pull.rb b/Library/Homebrew/cmd/pull.rb
index ac43bdad6..25abd9187 100644
--- a/Library/Homebrew/cmd/pull.rb
+++ b/Library/Homebrew/cmd/pull.rb
@@ -153,9 +153,25 @@ module Homebrew
safe_system "git", "merge", "--ff-only", "--no-edit", bottle_branch
safe_system "git", "branch", "-D", bottle_branch
- # TODO: publish on bintray
- # safe_system "curl", "-u#{user}:#{key}", "-X", "POST",
- # "https://api.bintray.com/content/homebrew/#{repo}/#{formula}/#{version}"
+ # Publish bottles on Bintray
+ bintray_user = ENV["BINTRAY_USER"]
+ bintray_key = ENV["BINTRAY_KEY"]
+ bintray_repo = if tap_name
+ tap_name.sub("/", "-") + "-bottles"
+ else
+ "bottles"
+ end
+
+ # Skip taps for now until we're using Bintray for Homebrew/homebrew
+ if bintray_user && bintray_key && !tap_name
+ changed_formulae.each do |f|
+ ohai "Publishing on Bintray:"
+ safe_system "curl", "--silent", "--fail",
+ "-u#{bintray_user}:#{bintray_key}", "-X", "POST",
+ "https://api.bintray.com/content/homebrew/#{bintray_repo}/#{f.name}/#{f.version}/publish"
+ puts
+ end
+ end
end
ohai 'Patch changed:'