erlef / rebar3_hex

Rebar3 Hex library
Apache License 2.0
101 stars 49 forks source link

Add support for replace package option #167

Closed starbelly closed 4 years ago

starbelly commented 4 years ago

hex_core and hex.pm have introduced an option to replace an existing package, this commit surfaces

Output of rebar3 help for publish command

Publishes a new version of a package with options to revert and replace existing packages

Supported commmand combinations:

  rebar3 hex publish

  rebar3 hex publish --yes

  rebar3 hex publish --repo <repo>

  rebar3 hex publish --repo <repo> --yes

  rebar3 hex publish --revert <version> --package <package>

  rebar3 hex publish --revert <version> --package <package> --yes

  rebar3 hex publish --replace

  rebar3 hex publish --replace --yes

Argument descriptions:

  <repo>    - a valid repository, only required when multiple repositories are configured

  <version> - a valid version string, currently only utilized with --revert switch

  <package> - a valid package name, currently only utilized with --revert switch

Usage: rebar3 hex publish [-r <repo>] [-y [<yes>]] [--replace [<replace>]]
                          [-p <package>] [--revert <revert>]

  -r, --repo     Repository to use for this command.
  -y, --yes      Publishes the package without any confirmation prompts
                 [default: false]
  --replace      Allows overwriting an existing package version if it
                 exists. Private packages can always be overwritten,
                 publicpackages can only be overwritten within one hour
                 after they were initially published. [default: false]
  -p, --package  Specifies the package to use with the publish command,
                 currently only utilized in a revert operation
  --revert       Revert given version, if the last version is reverted the
                 package is removed

TODO:

starbelly commented 4 years ago

One thing we could do here is support publishing a specific package since we've added a --package switch to support --revert as a switch. Thoughts?

starbelly commented 4 years ago

One thing we could do here is support publishing a specific package since we've added a --package switch to support --revert as a switch. Thoughts?

☝️ ignore this please. Will open another issue or set an agenda item for building & packaging to discuss this further.

tsloughter commented 4 years ago

@ferd you reviewed this?

@starbelly is it ready for merge?

I want to publish a release with my cut fix so figured it best to get all the PRs that are ready in first.

starbelly commented 4 years ago

@tsloughter Yeah, the only thing in question was the hacky way I'm silencing output in a test, but it's no solid reason to hold this up. Let me fix the conflict and merge.