Merge pull request #8847 from Rylan12/pr-upload-add-no-commit-flag

pr-upload: add --no-commit flag
This commit is contained in:
Jonathan Chang 2020-10-04 04:19:41 +11:00 committed by GitHub
commit cda13d1d9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 0 deletions

View File

@ -20,6 +20,8 @@ module Homebrew
"attempt to preserve its value in the generated DSL." "attempt to preserve its value in the generated DSL."
switch "-n", "--dry-run", switch "-n", "--dry-run",
description: "Print what would be done rather than doing it." description: "Print what would be done rather than doing it."
switch "--no-commit",
description: "Do not generate a new commit before uploading."
switch "--warn-on-upload-failure", switch "--warn-on-upload-failure",
description: "Warn instead of raising an error if the bottle upload fails. "\ description: "Warn instead of raising an error if the bottle upload fails. "\
"Useful for repairing bottle uploads that previously failed." "Useful for repairing bottle uploads that previously failed."
@ -66,6 +68,7 @@ module Homebrew
bottle_args << "--debug" if args.debug? bottle_args << "--debug" if args.debug?
bottle_args << "--keep-old" if args.keep_old? bottle_args << "--keep-old" if args.keep_old?
bottle_args << "--root-url=#{args.root_url}" if args.root_url bottle_args << "--root-url=#{args.root_url}" if args.root_url
bottle_args << "--no-commit" if args.no_commit?
bottle_args += json_files bottle_args += json_files
if args.dry_run? if args.dry_run?

View File

@ -9,6 +9,10 @@ This is a page for maintainers to diagnose certain build errors.
### Bottle publishes failed but the commits are correct in the git history ### Bottle publishes failed but the commits are correct in the git history
Follow these steps to fix this issue: Follow these steps to fix this issue:
* Download and extract the bottle artifact.
* `brew pr-upload --no-commit` in the bottle directory.
Alternative instructions using `pr-pull`:
* `git reset --hard <SHA>` in homebrew/core to reset to the commit before before all the commits created by `brew pr-pull`. * `git reset --hard <SHA>` in homebrew/core to reset to the commit before before all the commits created by `brew pr-pull`.
* `brew pr-pull <options>` to upload the right bottles. Add the `--warn-on-upload-failure` flag if the bottles have been partially uploaded and you're certain that the bottle checksums will match the checksums already present in the `bottle do` block of the formula. * `brew pr-pull <options>` to upload the right bottles. Add the `--warn-on-upload-failure` flag if the bottles have been partially uploaded and you're certain that the bottle checksums will match the checksums already present in the `bottle do` block of the formula.
* `git reset --hard origin/master` to return to the latest commit and discard the commits made by `brew pr-pull`. * `git reset --hard origin/master` to return to the latest commit and discard the commits made by `brew pr-pull`.

View File

@ -1177,6 +1177,8 @@ Apply the bottle commit and publish bottles to Bintray or GitHub Releases.
If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL. If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL.
* `-n`, `--dry-run`: * `-n`, `--dry-run`:
Print what would be done rather than doing it. Print what would be done rather than doing it.
* `--no-commit`:
Do not generate a new commit before uploading.
* `--warn-on-upload-failure`: * `--warn-on-upload-failure`:
Warn instead of raising an error if the bottle upload fails. Useful for repairing bottle uploads that previously failed. Warn instead of raising an error if the bottle upload fails. Useful for repairing bottle uploads that previously failed.
* `--bintray-org`: * `--bintray-org`:

View File

@ -1674,6 +1674,10 @@ If the formula specifies a rebuild version, attempt to preserve its value in the
Print what would be done rather than doing it\. Print what would be done rather than doing it\.
. .
.TP .TP
\fB\-\-no\-commit\fR
Do not generate a new commit before uploading\.
.
.TP
\fB\-\-warn\-on\-upload\-failure\fR \fB\-\-warn\-on\-upload\-failure\fR
Warn instead of raising an error if the bottle upload fails\. Useful for repairing bottle uploads that previously failed\. Warn instead of raising an error if the bottle upload fails\. Useful for repairing bottle uploads that previously failed\.
. .