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

fix(docs): update Heroku deployment instructions #11601

Merged
merged 3 commits into from
Feb 8, 2019

Conversation

JustinTRoss
Copy link
Contributor

Description

  • Added CLI instructions for adding Heroku buildpacks
  • Removed misleading instructions.

- Added CLI instructions for adding buildpacks
- Removed misleading instructions.
@JustinTRoss JustinTRoss requested a review from a team February 6, 2019 17:15
Copy link
Contributor

@DSchau DSchau left a comment

Choose a reason for hiding this comment

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

Looks good. Could you explain why the section you removed is misleading and why it's not needed?

Would just help me understand; thanks!

@JustinTRoss
Copy link
Contributor Author

Certainly. The section I removed was misleading for a couple reasons.

  1. Heroku doesn't run npm start if you're using heroku-buildpack-static. It's only if you're using heroku/node without heroku-buildpack-static.
  2. Serving from gatsby serve is an unoptimized alternative to heroku-buildpack-static, which itself creates a file server.

@JustinTRoss
Copy link
Contributor Author

@DSchau Let me know if you have any questions.

@DSchau DSchau changed the title Update Heroku deployment instructions fix(docs): update Heroku deployment instructions Feb 8, 2019
Copy link
Contributor

@DSchau DSchau left a comment

Choose a reason for hiding this comment

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

Thanks for this!

@DSchau DSchau merged commit 0878656 into gatsbyjs:master Feb 8, 2019
@gatsbot
Copy link

gatsbot bot commented Feb 8, 2019

Holy buckets, @JustinTRoss — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (Currently we’ve got a couple t-shirts available, plus some socks that are really razzing our berries right now.)
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

@aleccaputo
Copy link

hey guys quick question, i'm having trouble deploying to heroku, logs are dumping this out:

2019-02-11T03:38:51.734304+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/"

The app builds, but errors out when i try to access the domain. Any ideas why this is happening? I followed the heroku docs @JustinTRoss

@JustinTRoss JustinTRoss deleted the patch-1 branch February 11, 2019 04:36
@JustinTRoss
Copy link
Contributor Author

@aleccaputo I have only seen that when trying to serve with gatsby serve and/or trying to bind ports. Take a look at the log and make sure it's serving properly with heroku-buildpack-static.

@aleccaputo
Copy link

aleccaputo commented Feb 11, 2019

@JustinTRoss here's my build log

-----> Static HTML app detected
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
-----> Installed directory to /app/bin
-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       NODE_VERBOSE=false
       
-----> Installing binaries
       engines.node (package.json):  10.3.0
       engines.npm (package.json):   unspecified (use default)
       
       Resolving node version 10.3.0...
       Downloading and installing node 10.3.0...
       Using default npm version: 6.1.0
       
-----> Restoring cache
       - node_modules
       
-----> Building dependencies
       Installing node modules (package.json + package-lock)
       audited 25033 packages in 18.024s
       found 0 vulnerabilities
       
       Running heroku-postbuild
       
       > [email protected] heroku-postbuild /tmp/build_c4280b0f3235bcb2c9c2846e2429c77d
       > gatsby build
       
lscpu: failed to determine number of CPUs: /sys/devices/system/cpu/possible: No such file or directory
       success open and validate gatsby-configs — 0.133 s
       success load plugins — 0.305 s
       success onPreInit — 0.551 s
       success delete html and css files from previous builds — 0.007 s
       success initialize cache — 0.010 s
       success copy gatsby files — 0.032 s
       success onPreBootstrap — 0.006 s
       success source and transform nodes — 0.069 s
       success building schema — 0.423 s
       success createPages — 0.001 s
       success createPagesStatefully — 0.038 s
       success onPreExtractQueries — 0.005 s
       success update schema — 0.262 s
       success extract queries from components — 0.206 s
       success run graphql queries — 0.205 s — 4/4 19.58 queries/second
       success write out page data — 0.005 s
       success write out redirect data — 0.001 s
       
       
       info bootstrap finished - 4.738 s
       
       done generating icons for manifest
       success onPostBootstrap — 0.261 s
       success Building production JavaScript and CSS bundles — 8.960 s
       {"socialMediaLinks":{"linkedIn":"zzz","github":"xxx","email":"yyy"}}
       success Building static HTML for pages — 1.513 s — 1/1 3.94 pages/second
       info Done building in 15.476 sec
       
-----> Caching build
       - node_modules
       
-----> Pruning devDependencies
       audited 25033 packages in 16.56s
       found 0 vulnerabilities
       
       
-----> Build succeeded!
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for buildpack -> web
-----> Compressing...
       Done: 77.2M
-----> Launching...
       Released v8

@aleccaputo
Copy link

oh hey, i figured it out! Turns out somehow when i copy and pasted https://github.com/heroku/heroku-buildpack-static as a buildpack on heroku, it added .git to the end of the url. When i removed that, it fixed my issue. Not sure how that happened, I certainly didn't type it. I might have selected it from a suggestion it gave me

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.

3 participants