Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Migrate to Heroku #173

Merged
merged 3 commits into from
May 8, 2017
Merged

Migrate to Heroku #173

merged 3 commits into from
May 8, 2017

Conversation

clone1018
Copy link
Contributor

This pull request is what we need to move grtp.co to Heroku, besides the actual inside-heroku setup.

The grtp.co Heroku setup is two buildpacks in a specific order:

  1. index=1 heroku/nodejs
  2. index=2 https://github.com/heroku/heroku-buildpack-static.git

And adding a postinstall of make build. So really what's happening is heroku is installing nodejs for the build and then a simple nginx server serves up the www/ directory

Here's a demo:
https://grtp.herokuapp.com/v2.js

Deployment is now git push heroku master

@clone1018
Copy link
Contributor Author

Not ready yet! Doing work on the documentation now.


```
git remote add prod grtp@grtp.co:production
git remote add heroku https://git.heroku.com/grtp.git
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I normally prefer ssh key but this is Heroku recommended.

"headers": {
"/**": {
"Access-Control-Allow-Origin": "*",
"Strict-Transport-Security": "max-age=31536000; includeSubdomains;"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These might be too general but I can't see any risk since the grtp domain is already so far removed. Plus the rule before was including any html, js and json

@clone1018
Copy link
Contributor Author

Ready to review!

@chadwhitacre chadwhitacre merged commit 7a24493 into master May 8, 2017
@chadwhitacre chadwhitacre deleted the heroku_migration branch May 8, 2017 23:05
@techtonik
Copy link
Contributor

I don't see why this "post/pre"install step is needed at all if README is right saying that "The heroku/nodejs buildpack will then npm build the sources and save them in www. "

@clone1018
Copy link
Contributor Author

The heroku buildpack only saves the sources in www because we tell it to with the postinstall. Without that we would need to install some kind of temporary Procfile.

@techtonik
Copy link
Contributor

What does "npm install" do exactly? Can we just add build step as:

"install": "npm build & npm install",

Or it will fail as a recursive dependency?

@techtonik
Copy link
Contributor

My point of confusion is that npm install on package.json is about installing dependencies. Not about installing the package itself, right? Because if it is about installing package itself, there should be a package build step between installing dependencies and installing built package.

@clone1018
Copy link
Contributor Author

Well I'm definitely not a master. What can we do better and how should we improve this?

@techtonik
Copy link
Contributor

I don't know yet. Let's fix tests first - #170 - and think about this later.

P.S. I wish we had less vendor lockin, but going to Heroku is an awesome step compared to Nginx and SSH config before.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants