aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/cmd/pull.rb4
-rw-r--r--Library/Homebrew/cmd/test-bot.rb29
-rw-r--r--Library/Homebrew/software_spec.rb6
3 files changed, 38 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/pull.rb b/Library/Homebrew/cmd/pull.rb
index cf0b74543..ac43bdad6 100644
--- a/Library/Homebrew/cmd/pull.rb
+++ b/Library/Homebrew/cmd/pull.rb
@@ -152,6 +152,10 @@ module Homebrew
safe_system "git", "checkout", branch
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}"
end
ohai 'Patch changed:'
diff --git a/Library/Homebrew/cmd/test-bot.rb b/Library/Homebrew/cmd/test-bot.rb
index 2617aee87..732b44581 100644
--- a/Library/Homebrew/cmd/test-bot.rb
+++ b/Library/Homebrew/cmd/test-bot.rb
@@ -666,6 +666,10 @@ module Homebrew
id = ENV['UPSTREAM_BUILD_ID']
raise "Missing Jenkins variables!" unless jenkins and job and id
+ user = ENV["BINTRAY_USER"]
+ key = ENV["BINTRAY_KEY"]
+ raise "Missing Bintray variables!" unless user && key
+
ARGV << '--verbose'
bottles = Dir["#{jenkins}/jobs/#{job}/configurations/axis-version/*/builds/#{id}/archive/*.bottle*.*"]
@@ -706,6 +710,7 @@ module Homebrew
tag = pr ? "pr-#{pr}" : "testing-#{number}"
safe_system "git", "push", "--force", remote, "master:master", ":refs/tags/#{tag}"
+ # SourceForge upload (will be removed soon)
path = "/home/frs/project/m/ma/machomebrew/Bottles/"
if tap
tap_user, tap_repo = tap.split "/"
@@ -717,6 +722,30 @@ module Homebrew
rsync_args += Dir["*.bottle*.tar.gz"] + [url]
safe_system "rsync", *rsync_args
+
+ # Bintray upload (will take over soon)
+ repo = if tap
+ tap.sub("/", "-") + "-bottles"
+ else
+ "bottles"
+ end
+
+ Dir.glob("*.bottle*.tar.gz") do |filename|
+ # Skip taps for now until we're using Bintray for Homebrew/homebrew
+ next if tap
+ version = BottleVersion.parse(filename).to_s
+ formula = bottle_filename_formula_name filename
+
+ package_url = "https://api.bintray.com/packages/homebrew/#{repo}/#{formula}"
+ unless system "curl", "--silent", "--fail", "--output", "/dev/null", package_url
+ safe_system "curl", "-H", "Content-Type: application/json",
+ "-d", "{'name':'#{formula}','licenses':['MIT']}", package_url
+ end
+
+ safe_system "curl", "-u#{user}:#{key}", "-T", filename,
+ "#{package_url}/#{version}/#{filename}"
+ end
+
safe_system "git", "tag", "--force", tag
safe_system "git", "push", "--force", remote, "refs/tags/#{tag}"
return
diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb
index a1fba5661..f0e0c3493 100644
--- a/Library/Homebrew/software_spec.rb
+++ b/Library/Homebrew/software_spec.rb
@@ -251,7 +251,11 @@ end
class BottleSpecification
DEFAULT_PREFIX = "/usr/local".freeze
DEFAULT_CELLAR = "/usr/local/Cellar".freeze
- DEFAULT_ROOT_URL = "https://downloads.sf.net/project/machomebrew/Bottles".freeze
+ if ENV["HOMEBREW_BINTRAY_TESTING"]
+ DEFAULT_ROOT_URL = "https://bintray.com/artifact/download/homebrew/bottles".freeze
+ else
+ DEFAULT_ROOT_URL = "https://downloads.sf.net/project/machomebrew/Bottles".freeze
+ end
attr_rw :root_url, :prefix, :cellar, :revision
attr_reader :checksum, :collector