Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy: first take to handle bump deploy command 🎉 #10

Merged
merged 2 commits into from
May 7, 2021
Merged

deploy: first take to handle bump deploy command 🎉 #10

merged 2 commits into from
May 7, 2021

Conversation

paulRbr
Copy link
Member

@paulRbr paulRbr commented Apr 27, 2021

⚠️ Please take a look at #12 before reading this PR ⚠️

Similarly to #8 this PR adds the new bump deploy command with lots of simplification compared to the current CLI (same flags removed as in #8).

Help section

Create a new version of your documentation for the given file

USAGE
  $ bump deploy FILE

ARGUMENTS
  FILE  Path or URL to your API documentation file. OpenAPI (2.0 to 3.1.0) and AsyncAPI (2.0)
        specifications are currently supported.

OPTIONS
  -b, --hub=hub            Hub id or slug. Can be provided via BUMP_HUB_ID environment
                           variable

  -d, --doc=doc            (required) Documentation public id or slug. Can be provided via
                           BUMP_ID environment variable

  -h, --help               show CLI help

  -n, --doc-name=doc-name  Documentation name. Used with --auto-create flag.

  -t, --token=token        Documentation or Hub token. Can be provided via BUMP_TOKEN
                           environment variable

  --auto-create            Automatically create the documentation if needed (only available
                           with a --hub flag). Documentation name can be provided with
                           --doc-name flag. Default: false

EXAMPLES
  Deploy a new version of an existing documentation

  $> bump deploy FILE --doc <your_doc_id_or_slug> --token <your_doc_token>
  * Let's deploy a new documentation version on Bump... done
  * Your new documentation version will soon be ready

  Deploy a new version of an existing documentation attached to a hub

  $> bump deploy FILE --doc <doc_slug> --hub <your_hub_id_or_slug> --token <your_doc_token>
  * Let's deploy a new documentation version on Bump... done
  * Your new documentation version will soon be ready

Example usage

> BUMP_HOST=http://localhost:3000/ ./bin/run deploy \
    --token "086e7240c0a4a5de2b6554888f572897" \
    --doc "46da5153-f04a-4979-8181-093a4c71cc6f" \
    ../bump/doc/api/v1/openapi.v3.yml
* Let's deploy a new documentation version on Bump... done
* Your new documentation version will soon be ready

Remaining todos


Closes #3

@paulRbr paulRbr marked this pull request as ready for review April 30, 2021 22:02
@paulRbr paulRbr requested a review from scharrier April 30, 2021 22:02
@scharrier
Copy link
Member

Hey! I started to review, but I think that we should extract all the refactorings into another, dedicated PR. This would make it easier to review, and would probably create a cleaner history in our PR. WDYT?

Copy link
Member

@scharrier scharrier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't finished my review (and I have to leave from now), but I though you'd be happy to directly get my first bunch of comments. I haven't review the command code, neither the tests.

I'm super excited to see this going to production soon :D

README.md Show resolved Hide resolved
src/api/error.ts Outdated Show resolved Hide resolved
src/api/index.ts Outdated Show resolved Hide resolved
src/api/index.ts Outdated Show resolved Hide resolved
src/api/index.ts Outdated Show resolved Hide resolved
src/api/index.ts Outdated Show resolved Hide resolved
src/api/models.ts Outdated Show resolved Hide resolved
src/command.ts Outdated Show resolved Hide resolved
src/commands/deploy.ts Outdated Show resolved Hide resolved
src/commands/deploy.ts Show resolved Hide resolved
This commit adds an optional token private attribute on the Base
command of our CLI to be able to send an authorization header when
interacting with the Bump API.
Copy link
Member

@scharrier scharrier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left one important comment, about how we handle the token. Besides this, LGTM. So if we agree on it, this can be merged. If not, let me know your point of view so we can take a decision.

Great work, it's really clean 👍

src/api/error.ts Show resolved Hide resolved
src/command.ts Outdated Show resolved Hide resolved
src/flags.ts Outdated Show resolved Hide resolved
@paulRbr paulRbr requested a review from scharrier May 6, 2021 16:25
Copy link
Member

@scharrier scharrier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the last changes. Let's merge this one too!

@paulRbr paulRbr merged commit fe7ecdf into bump-sh:main May 7, 2021
@paulRbr paulRbr deleted the deploy-basic-command branch May 7, 2021 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement basic deploy
2 participants