icps

notes

Heroku

build

heroku login
heroku create [name]

app name

cat .git/config | grep heroku.com | awk -F [/.] '{print $6}'

heroku git:remote -a `cat .git/config | grep heroku.com | awk -F [/.] '{print $6}'`
git init

upload

git commit -am '`date +%Y-%m-%d:%H:%M:%S`'
git push heroku master

1
2
3
4
5
#Gemfile
group :production do
    gem 'rails_12factor'
    gem 'pg'
end

reset base

heroku restart; heroku pg:reset DATABASE --confirm `cat .git/config | grep heroku.com | awk -F [/.] '{print $6}'` && heroku run rake db:migrate

heroku run rails db:seed

rename app

git remote rm heroku
heroku git:remote -a [new_app_name]

sync database

PGUSER=postgres PGPASSWORD=passwd heroku pg:push local_database heroku_datbase --app app PGUSER=postgres PGPASSWORD=passwd heroku pg:pull heroku_datbase local_database --app app

watir

ref >> https://www.simon-neutert.de/2018/watir-chrome-heroku/ add buildpacks:

1
2
3
4
https://github.com/heroku/heroku-buildpack-google-chrome
https://github.com/heroku/heroku-buildpack-chromedriver
gem 'waitr'
require 'watir'

switch

ref >> https://github.com/heroku/heroku-accounts

add accounts

heroku accounts:add username

switch accounts

heroku accounts:set username

list accounts

heroku accounts

No migration with version number

heroku pg:psql delete from schema_migrations where version= 'XXXXXXXXXXX';

get rows

heroku pg:info

heroku plugins:install heroku-pg-extras heroku pg:index_usage