From 1a91945c76e17a5dbd0ccb4367126c254d2440dc Mon Sep 17 00:00:00 2001 From: Eric Sauter Date: Mon, 7 Mar 2016 17:44:45 -0500 Subject: [PATCH] Remove use of heroku-buildpack-multi as primary deployment option since heroku supports multiple buildpacks natively. --- docs/additional_reading/heroku_deployment.md | 12 ++++++------ docs/tutorial-v2.md | 5 +++-- .../react_on_rails/heroku_deployment_generator.rb | 3 +-- .../templates/heroku_deployment/.buildpacks | 2 -- .../heroku_deployment_generator_examples.rb | 1 - 5 files changed, 10 insertions(+), 13 deletions(-) delete mode 100644 lib/generators/react_on_rails/templates/heroku_deployment/.buildpacks diff --git a/docs/additional_reading/heroku_deployment.md b/docs/additional_reading/heroku_deployment.md index 4d7ee5b9e..bc2fe4333 100644 --- a/docs/additional_reading/heroku_deployment.md +++ b/docs/additional_reading/heroku_deployment.md @@ -2,7 +2,6 @@ The generator has created the necessary files and gems for deployment to Heroku. If you have installed manually, you will need to provide these files yourself: + `Procfile`: used by Heroku and Foreman to start the Puma server -+ `.buildpacks`: used to install Ruby and Node environments + `12factor` gem: required by Heroku + `'puma'` gem: recommended Heroku webserver + `config/puma.rb`: Puma webserver config file @@ -10,18 +9,19 @@ The generator has created the necessary files and gems for deployment to Heroku. ## How to Deploy -React on Rails requires both a ruby environment (for Rails) and a Node environment (for Webpack), so you will need to have Heroku use multiple buildpacks. Currently, we would suggest using [DDollar's Heroku Buildpack Multi](https://github.com/ddollar/heroku-buildpack-multi). +React on Rails requires both a ruby environment (for Rails) and a Node environment (for Webpack), so you will need to have Heroku use multiple buildpacks. -Assuming you have downloaded and installed the Heroku command-line utility and have initialized the app, you will need to tell Heroku to use Heroku Buildpack Multi via the command-line: +Assuming you have downloaded and installed the Heroku command-line utility and have initialized the app, you will need to tell Heroku to use both buildpacks via the command-line: ``` -heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi +heroku buildpacks:set heroku/ruby +heroku buildpacks:add --index 1 heroku/nodejs ``` -Heroku will now be able to use the multiple buildpacks specified in `.buildpacks`. - For more information, see [Using Multiple Buildpacks for an App](https://devcenter.heroku.com/articles/using-multiple-buildpacks-for-an-app) +If for some reason you need custom buildpacks that are not officially supported by Heroku ([see this page](https://devcenter.heroku.com/articles/buildpacks)), we recommend checking out [heroku-buildpack-multi](https://github.com/ddollar/heroku-buildpack-multi). + ## Fresh Rails Install ### Swap out sqlite for postgres by doing the following: diff --git a/docs/tutorial-v2.md b/docs/tutorial-v2.md index 1fbe3f252..5131d95d3 100644 --- a/docs/tutorial-v2.md +++ b/docs/tutorial-v2.md @@ -146,9 +146,10 @@ Run this command that looks like this from your new heroku app heroku git:remote -a my-name-react-on-rails -Set the correct buildpack for using react-on-rails: +Set heroku to use multiple buildpacks: - heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi + heroku buildpacks:set heroku/ruby + heroku buildpacks:add --index 1 heroku/nodejs ### Swap out sqlite for postgres by doing the following: diff --git a/lib/generators/react_on_rails/heroku_deployment_generator.rb b/lib/generators/react_on_rails/heroku_deployment_generator.rb index f18315ebf..da07f72c5 100644 --- a/lib/generators/react_on_rails/heroku_deployment_generator.rb +++ b/lib/generators/react_on_rails/heroku_deployment_generator.rb @@ -10,8 +10,7 @@ class HerokuDeploymentGenerator < Rails::Generators::Base def copy_heroku_deployment_files base_path = "heroku_deployment" - %w(.buildpacks - Procfile + %w(Procfile config/puma.rb).each { |file| copy_file("#{base_path}/#{file}", file) } end diff --git a/lib/generators/react_on_rails/templates/heroku_deployment/.buildpacks b/lib/generators/react_on_rails/templates/heroku_deployment/.buildpacks deleted file mode 100644 index 9fb124257..000000000 --- a/lib/generators/react_on_rails/templates/heroku_deployment/.buildpacks +++ /dev/null @@ -1,2 +0,0 @@ -https://github.com/heroku/heroku-buildpack-nodejs.git -https://github.com/heroku/heroku-buildpack-ruby.git diff --git a/spec/react_on_rails/support/shared_examples/heroku_deployment_generator_examples.rb b/spec/react_on_rails/support/shared_examples/heroku_deployment_generator_examples.rb index 741796fde..a4276ab78 100644 --- a/spec/react_on_rails/support/shared_examples/heroku_deployment_generator_examples.rb +++ b/spec/react_on_rails/support/shared_examples/heroku_deployment_generator_examples.rb @@ -1,7 +1,6 @@ shared_examples "heroku_deployment" do it "should add heroku deployment files" do assert_file("Procfile") - assert_file(".buildpacks") end it "should add heroku production gems" do