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

Add --no-progress to gatsby build for less verbose build output #17873

Closed
brettinternet opened this issue Sep 25, 2019 · 4 comments
Closed

Add --no-progress to gatsby build for less verbose build output #17873

brettinternet opened this issue Sep 25, 2019 · 4 comments
Labels
good first issue Issue that doesn't require previous experience with Gatsby type: documentation An issue or pull request for improving or updating Gatsby's documentation

Comments

@brettinternet
Copy link
Contributor

Summary

Currently, the gatsby build command is particularly verbose with progress updates. This causes heavy output for dumb terminals like Jenkins which print a new line for every animation:

gatsby build command screenshot

Current workaround

I was fortunate to find an open issue analyzing the effects of Ink on the the build time. I found the suggestion to set an environment variable CI=true.

So to my build script looks like this:

cross-env CI=true gatsby build

Basic example

It seems a --no-progress or --quiet option similar to the npm arg should be available to gatsby build.

Would having a --no-progress build argument setting the CI environment variable be appropriate?

Motivation

An alternative solution would be to hold the CI environment variable as a feature and document it. While it's a workaround for me, I worry about the functionality changing since it's not a documented feature. @wardpeet pointed out that most CI vendors enable CI=true, but I wasn't aware of this. We use a self-hosted instance of Jenkins rather than a CI vendor.


Thank you to the contributors for all your attention to such an awesome project!

@bitttttten
Copy link

Looks like an issue with https://github.com/sindresorhus/ora no? IIRC that is the library used for the progress spinner.

@sidharthachatterjee
Copy link
Contributor

An alternative solution would be to hold the CI environment variable as a feature and document it. While it's a workaround for me, I worry about the functionality changing since it's not a documented feature. @wardpeet pointed out that most CI vendors enable CI=true, but I wasn't aware of this. We use a self-hosted instance of Jenkins rather than a CI vendor.

Not sure about --no-progress but this is a good idea. Would you like to open an PR documenting it?

@sidharthachatterjee sidharthachatterjee added good first issue Issue that doesn't require previous experience with Gatsby type: documentation An issue or pull request for improving or updating Gatsby's documentation and removed type: feature or enhancement labels Sep 26, 2019
@gagandeepp
Copy link

can i taket a look on this one?

@sidharthachatterjee
Copy link
Contributor

Documented in #17966

Let's close this for now

pvdz added a commit that referenced this issue Nov 28, 2019
…his way

This change explicitly throttles the progress bar updates (`tick` and `total`) to be clamped to 10 fps max.

This drops the govbook benchmark from 210 seconds down to 140 seconds.

Fixes #15505
Fixes #17452
Fixes #17966
Fixes #18801

Relates to #17873
Relates to vadimdemedes/ink#212
gatsbybot pushed a commit that referenced this issue Nov 28, 2019
…19866)

* perf(gatsby-cli): throttle progress bar, build significantly faster this way

This change explicitly throttles the progress bar updates (`tick` and `total`) to be clamped to 10 fps max.

This drops the govbook benchmark from 210 seconds down to 140 seconds.

Fixes #15505
Fixes #17452
Fixes #17966
Fixes #18801

Relates to #17873
Relates to vadimdemedes/ink#212

* Force flush on done() and use local var for total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issue that doesn't require previous experience with Gatsby type: documentation An issue or pull request for improving or updating Gatsby's documentation
Projects
None yet
Development

No branches or pull requests

5 participants