Help Center


Deploy on Heroku

https://app.chaskiq.io/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbXdEIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--827f2d0b5794f7bb660c48b79e228655bd857bed/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCem9MWm05eWJXRjBTU0lJYW5CbkJqb0dSVlE2RkhKbGMybDZaVjkwYjE5c2FXMXBkRnNIYVdscGFRPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--cf24ea7784b3789671bb09c4029aca003c26b32d/me.jpg

Written by Miguel Michelson

updated

Heroku is the easiest way to deploy Chaskiq there are two main modes on which you can deploy the application, the first way is using the Heroku button , this will not require any local installation and will handle all the heavy lifting for you.
The second way is cloning the repo and installing it though the Heroku client. let's dig into it.

Introduction

This tutorial will have you deploying a Ruby app in minutes. Hang on for a few more minutes to learn how it all works, so you can make the most out of Heroku.The tutorial assumes that you have:

Set up

The Heroku CLI requires Git, the popular version control system. If you don’t already have Git installed, complete the following before proceeding: Git installation First-time Git setup
In this step you’ll install the Heroku Command Line Interface (CLI). You use the CLI to manage and scale your applications, provision add-ons, view your application logs, and run your application locally.
https://devcenter.heroku.com/articles/getting-started-with-ruby#set-up

Prepare the App

To clone the sample application so that you have a local version of the code that you can then deploy to Heroku, execute the following commands in your local command shell or terminal:

$ git clone https://github.com/chaskiq/chaskiq.git
$ cd chaskiq

You now have a functioning git repository that contains a simple application as well as a Gemfile file, which is used by Ruby’s dependency manager, bundler.

Deploy the app

In this step you will deploy the app to Heroku. Create an app on Heroku, which prepares Heroku to receive your source code.

$ heroku create
Creating app... done, ⬢ polar-inlet-4930
http://polar-inlet-4930.herokuapp.com/ | https://git.heroku.com/polar-inlet-4930.git
Git remote heroku added

When you create an app, a git remote (called heroku) is also created and associated with your local git repository.Heroku generates a random name (in this case polar-inlet-4930) for your app, or you can pass a parameter to specify your own app name.Now deploy your code:

$ git push heroku master

Configure Environment

Note that you will need setup some environment variables first in order to work properly, (this is not required if you install it through heroku button) please refer to the heroku env vars managment https://devcenter.heroku.com/articles/config-vars the required env vars:

Select...HOST=https://YOUR_HEROKU_APP_DOMAIN
ASSET_HOST=https://YOUR_HEROKU_APP_DOMAIN
WS=wss://YOUR_HEROKU_APP_DOMAIN/cable

SES_ADDRESS=
SES_USER_NAME=
SES_PASSWORD=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_S3_BUCKET=
AWS_S3_REGION=
ADMIN_EMAIL=your@email.com
ADMIN_PASSWORD=123456
SNS_CONFIGURATION_SET=metrics

Important things are your HOST and WS vars and ADMIN_EMAIL and ADMIN_PASSWORD for initial admin generation and the AWS credentials


Now that you have successfully installed the app, run these commands:

heroku run rails db:migrate
heroku run rails db:seed

Create New Admin

The rails admin_generator task will create an admin user for you, you will need to have an ADMIN_EMAIL and ADMIN_PASSWORD on your .env try this credentials:

heroku run rails admin_generator

The application is now deployed and data migrated. Now visit the app at the URL generated by its app name. As a handy shortcut, you can open the website as follows:

$ heroku open

Happy Chatting!