test-bot: simplify the upload logic
If the bottle is already published, let's fail directly. Also silent the curl output. Closes Homebrew/homebrew#40295. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
45a71898e8
commit
296ca61510
@ -789,6 +789,14 @@ module Homebrew
|
|||||||
version = formula.pkg_version
|
version = formula.pkg_version
|
||||||
bintray_package = Bintray.package formula_name
|
bintray_package = Bintray.package formula_name
|
||||||
|
|
||||||
|
if system "curl", "-I", "--silent", "--fail", "--output", "/dev/null",
|
||||||
|
"#{BottleSpecification::DEFAULT_DOMAIN}/#{bintray_repo}/#{filename}"
|
||||||
|
raise <<-EOS.undent
|
||||||
|
#{filename} is already published. Please remove it manually from
|
||||||
|
https://bintray.com/homebrew/#{bintray_repo}/#{bintray_package}/view#files
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
unless formula_packaged[formula_name]
|
unless formula_packaged[formula_name]
|
||||||
package_url = "#{bintray_repo_url}/#{bintray_package}"
|
package_url = "#{bintray_repo_url}/#{bintray_package}"
|
||||||
unless system "curl", "--silent", "--fail", "--output", "/dev/null", package_url
|
unless system "curl", "--silent", "--fail", "--output", "/dev/null", package_url
|
||||||
@ -802,10 +810,7 @@ module Homebrew
|
|||||||
|
|
||||||
content_url = "https://api.bintray.com/content/homebrew"
|
content_url = "https://api.bintray.com/content/homebrew"
|
||||||
content_url += "/#{bintray_repo}/#{bintray_package}/#{version}/#{filename}"
|
content_url += "/#{bintray_repo}/#{bintray_package}/#{version}/#{filename}"
|
||||||
unless system "curl", "-I", "--fail", "--output", "/dev/null",
|
content_url += "?override=1"
|
||||||
"https://homebrew.bintray.com/#{bintray_repo}/#{filename}"
|
|
||||||
content_url += "?override=1"
|
|
||||||
end
|
|
||||||
curl "--silent", "--fail", "-u#{bintray_user}:#{bintray_key}",
|
curl "--silent", "--fail", "-u#{bintray_user}:#{bintray_key}",
|
||||||
"-T", filename, content_url
|
"-T", filename, content_url
|
||||||
puts
|
puts
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user