aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2017-03-25 20:23:53 +0000
committerGitHub2017-03-25 20:23:53 +0000
commit422afa0b49bae84e707cb3f66faf2da32cb4c462 (patch)
tree4b0905f365232e5bf475af79e3dfa4d75236bb72
parent17acb3a91cc399410ce6fa9b00280a7434fcd9a1 (diff)
parente72313143880def84ae65fa57f730b3af460ce0a (diff)
downloadbrew-422afa0b49bae84e707cb3f66faf2da32cb4c462.tar.bz2
Merge pull request #1975 from MikeMcQuaid/pull-not-die-bottle-publish
pull: warn (not die) on bottle publish failure.
-rw-r--r--Library/Homebrew/dev-cmd/pull.rb15
-rw-r--r--docs/Manpage.md6
-rw-r--r--manpages/brew.17
3 files changed, 23 insertions, 5 deletions
diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb
index ec89b14b8..36c9ac27c 100644
--- a/Library/Homebrew/dev-cmd/pull.rb
+++ b/Library/Homebrew/dev-cmd/pull.rb
@@ -1,4 +1,5 @@
-#: * `pull` [`--bottle`] [`--bump`] [`--clean`] [`--ignore-whitespace`] [`--resolve`] [`--branch-okay`] [`--no-pbcopy`] [`--no-publish`] <patch-source> [<patch-source>]:
+#: * `pull` [`--bottle`] [`--bump`] [`--clean`] [`--ignore-whitespace`] [`--resolve`] [`--branch-okay`] [`--no-pbcopy`] [`--no-publish`] [`--warn-on-publish-failure`] <patch-source> [<patch-source>]:
+#:
#: Gets a patch from a GitHub commit or pull request and applies it to Homebrew.
#: Optionally, installs the formulae changed by the patch.
#:
@@ -37,6 +38,9 @@
#: clipboard.
#:
#: If `--no-publish` is passed, do not publish bottles to Bintray.
+#:
+#: If `--warn-on-publish-failure` was passed, do not exit if there's a
+#: failure publishing bottles on Bintray.
require "net/http"
require "net/https"
@@ -264,7 +268,7 @@ module Homebrew
changed_formulae_names.each do |name|
f = Formula[name]
next if f.bottle_unneeded? || f.bottle_disabled?
- publish_bottle_file_on_bintray(f, bintray_creds)
+ next unless publish_bottle_file_on_bintray(f, bintray_creds)
published << f.full_name
end
else
@@ -425,7 +429,7 @@ module Homebrew
end
unless info.bottle_info_any
opoo "No bottle defined in formula #{package}"
- return
+ return false
end
version = info.pkg_version
ohai "Publishing on Bintray: #{package} #{version}"
@@ -434,6 +438,11 @@ module Homebrew
"-H", "Content-Type: application/json",
"-d", '{"publish_wait_for_secs": 0}',
"https://api.bintray.com/content/homebrew/#{repo}/#{package}/#{version}/publish"
+ true
+ rescue => e
+ raise unless ARGV.include?("--warn-on-publish-failure")
+ onoe e
+ false
end
# Formula info drawn from an external "brew info --json" call
diff --git a/docs/Manpage.md b/docs/Manpage.md
index 43207113b..8401248ae 100644
--- a/docs/Manpage.md
+++ b/docs/Manpage.md
@@ -746,7 +746,8 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
Additionally, the date used in new manpages will match those in the existing
manpages (to allow comparison without factoring in the date).
- * `pull` [`--bottle`] [`--bump`] [`--clean`] [`--ignore-whitespace`] [`--resolve`] [`--branch-okay`] [`--no-pbcopy`] [`--no-publish`] <var>patch-source</var> [<var>patch-source</var>]:
+ * `pull` [`--bottle`] [`--bump`] [`--clean`] [`--ignore-whitespace`] [`--resolve`] [`--branch-okay`] [`--no-pbcopy`] [`--no-publish`] [`--warn-on-publish-failure`] <var>patch-source</var> [<var>patch-source</var>]:
+
Gets a patch from a GitHub commit or pull request and applies it to Homebrew.
Optionally, installs the formulae changed by the patch.
@@ -786,6 +787,9 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--no-publish` is passed, do not publish bottles to Bintray.
+ If `--warn-on-publish-failure` was passed, do not exit if there's a
+ failure publishing bottles on Bintray.
+
* `release-notes` [`--markdown`] [<var>previous_tag</var>] [<var>end_ref</var>]:
Output the merged pull requests on Homebrew/brew between two Git refs.
If no <var>previous_tag</var> is provided it defaults to the newest tag.
diff --git a/manpages/brew.1 b/manpages/brew.1
index bdda89fb0..9a1775233 100644
--- a/manpages/brew.1
+++ b/manpages/brew.1
@@ -770,7 +770,9 @@ Generate Homebrew\'s manpages\.
If \fB\-\-fail\-if\-changed\fR is passed, the command will return a failing status code if changes are detected in the manpage outputs\. This can be used for CI to be notified when the manpages are out of date\. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date)\.
.
.TP
-\fBpull\fR [\fB\-\-bottle\fR] [\fB\-\-bump\fR] [\fB\-\-clean\fR] [\fB\-\-ignore\-whitespace\fR] [\fB\-\-resolve\fR] [\fB\-\-branch\-okay\fR] [\fB\-\-no\-pbcopy\fR] [\fB\-\-no\-publish\fR] \fIpatch\-source\fR [\fIpatch\-source\fR]
+\fBpull\fR [\fB\-\-bottle\fR] [\fB\-\-bump\fR] [\fB\-\-clean\fR] [\fB\-\-ignore\-whitespace\fR] [\fB\-\-resolve\fR] [\fB\-\-branch\-okay\fR] [\fB\-\-no\-pbcopy\fR] [\fB\-\-no\-publish\fR] [\fB\-\-warn\-on\-publish\-failure\fR] \fIpatch\-source\fR [\fIpatch\-source\fR]:
+.
+.IP
Gets a patch from a GitHub commit or pull request and applies it to Homebrew\. Optionally, installs the formulae changed by the patch\.
.
.IP
@@ -812,6 +814,9 @@ If \fB\-\-no\-pbcopy\fR is passed, do not copy anything to the system clipboard\
.IP
If \fB\-\-no\-publish\fR is passed, do not publish bottles to Bintray\.
.
+.IP
+If \fB\-\-warn\-on\-publish\-failure\fR was passed, do not exit if there\'s a failure publishing bottles on Bintray\.
+.
.TP
\fBrelease\-notes\fR [\fB\-\-markdown\fR] [\fIprevious_tag\fR] [\fIend_ref\fR]
Output the merged pull requests on Homebrew/brew between two Git refs\. If no \fIprevious_tag\fR is provided it defaults to the newest tag\. If no \fIend_ref\fR is provided it defaults to \fBorigin/master\fR\.