Deploying to Heroku - restarone/violet_rails GitHub Wiki

View the demo app here: https://violet-rails.herokuapp.com/

Prep the local repo and push to heroku

Clone the repository and add the heroku remote origin

git clone [email protected]:restarone/violet_rails.git
# if you don't have a remote origin, you can run: 
heroku create
# if you have an existing heroku remote origin then connect it: 
heroku git:remote -a your-app-here

Then login to heroku and provision a postgres database and redis-to-go for the app manually: https://elements.heroku.com/addons/heroku-postgresql https://elements.heroku.com/addons/redistogo

Push to heroku

git push heroku master

login to the heroku console and set your environment variables, you will need to set all of these to the appropriate values to get full functionality. Here are all the relevant configurations variables for Heroku

APP_HOST=example.com
MAILGUN_API_KEY=foo
MAILGUN_INGRESS_SIGNING_KEY=foo
AWS_ACCESS_KEY_ID=foo
AWS_SECRET_ACCESS_KEY=foo
AWS_REGION=us-east-1
AWS_BUCKET=example.com
REDIS_URL=REDISTOGO_URL

make sure to copy the REDISTOGO_URL (this is immutable in heroku) as the REDIS_URL

setup the application and your root account

migrate the database on heroku:

heroku run rake db:migrate 

to bootstrap the stubbed landing page for the domain, first jump into the rails console on the app by running:

heroku console 

then run the generators that will create the root subdomain (for the domain apex) and the stubbed landing page: https://github.com/restarone/violet_rails/wiki/First-time-setup-script-(after-deployment)

this will grant you permissions for managing subdomains with your domain and inviting other users/editing permissions

At this point, most things should work

You will need to setup storage next, for that we will configure AWS S3 like this: https://github.com/restarone/violet_rails/wiki/Production-AWS-setup