Heroku

For committers: pushing changes to staging on Heroku
This information is for people who are committers on the project, and have been added as collaborators on the growstuff-dev project on Heroku.

Skip the first few steps if you've already done them.


 * 1) Sign up for an account on http://heroku.com/
 * 2) Download the "Heroku Toolbelt" for your OS (they should give you a link the first time you login) and install them
 * 3) On your own machine,
 * 4) Generate an SSH key if you don't already have one (See: Ssh)
 * 5)   (or wherever you keep your growstuff git directory)
 * 6) Set   to be your default Heroku remote:
 * 7) Check it's connecting properly:
 * 8) There should be no need to configure any environment variables. Run   to check: if the answer is   then all is well.
 * 1) There should be no need to configure any environment variables. Run   to check: if the answer is   then all is well.

To use Heroku for your own dev instance
This is for any developer on Growstuff. You might want to do this if you want people not on your local network to be able to see the dev work you're doing.

The following steps are summarised from these help pages on the Heroku site:


 * Quickstart
 * Getting started with Rails 3.x

Here are the steps, customised for Growstuff:


 * 1) Sign up for an account on http://heroku.com/
 * 2) Download the "Heroku Toolbelt" for your OS (they should give you a link the first time you login) and install them
 * 3) On your own machine,
 * 4) Generate an SSH key if you don't already have one (See: Ssh)
 * 5)   (or wherever you keep your growstuff git directory)
 * 6)   to create an app on heroku. (Put your username there, or whatever. If you don't specify, it will give you a weird adjective-noun-9999 name, which you may or may not care about.)
 * 7)   (assuming you want it to be a dev environment)
 * 8) You'll probably want to also use   to set all the environment variables that are in your credentials.sh (various API keys, etc).  If you don't, various bits of the site won't work.
 * 9) You might also want to set up add-ons for Mandrill etc (especially if you want to send email from your instance, which you will if you want to create users etc.)
 * 10)   (or whatever branch you were thinking of deploying)
 * 11)   (This pushes the current dev branch to master on heroku, which is necessary because heroku won't actually build/run the app if you push to any other branch. I don't know why.)
 * 12) This should now automatically run
 * 13)   and, if you want the default set of crops and test users,.
 * 14) Go look at your app, i.e. http://YOURNAME-growstuff-dev.heroku.com/ (the URL should be cut and pasteable from your terminal) or you can just type   from the command line and it should launch the site in your default browser. Most of the site should be working at this point.

Adding mandrill support
Follow steps here: https://devcenter.heroku.com/articles/mandrill


 * first, verify your account (i.e. add a credit card) via https://heroku.com/verify -- note that first 12,000 emails are free so for low usage you won't be charged anything
 * In my case, it didn't seem to set the MANDRILL_APIKEY config so I did this:
 * choose "SMTP", then click "Add API key"
 * copy-paste the username and api key and do this:  (replacing as needed)
 * should now return the API key you just set
 * I edited  to send email through Mandrill, committed (locally), pushed to heroku with   (heroku_environments was the branch I was working on) and voila, it worked!
 * Note that all this uses a heroku-specific Mandrill account, which is separate from the Mailchimp/Mandrill account we already had in Growstuff's name. Oh well.
 * I edited  to send email through Mandrill, committed (locally), pushed to heroku with   (heroku_environments was the branch I was working on) and voila, it worked!
 * Note that all this uses a heroku-specific Mandrill account, which is separate from the Mailchimp/Mandrill account we already had in Growstuff's name. Oh well.