Skip to content

Heroku useful command list

Yohei Yamaguchi edited this page May 21, 2016 · 2 revisions

Config for Heroku

Add the config below to your .git/config.

[remote "heroku"]
    url = https://git.heroku.com/line-shift-bot.git
    fetch = +refs/heads/*:refs/remotes/heroku/*

Then, you can access to heroku with git.

Log

// check the latest part of the log.
$ heroku logs

// tail the log
$ heroku logs -t

Access to pgsql

// Preparation: You need to install Postgre SQL in your dev env.
$ brew install postgresql

// login to pg
$ heroku pg:psql

Update DB schema

// edit create.sql
$ vim db/create.sql

// Apply DDL to the database
$ heroku pg:psql < db/create.sql

// Please add test fixture after updating DDL because tables are dropped by applying create.sql
$ heroku pg:psql < db/testData.sql

Deploy your app

$ git push heroku <your_branch>
$ git push heroku <your_branch>:master -f

Troubleshooting

You do not have access to the app line-shift-bot.

Please ask Kai to add you to collaborators of heroku app.

$ heroku logs
 ▸    You do not have access to the app line-shift-bot.
Clone this wiki locally