mcaz
10/12/2019 - 5:55 PM

laas: server: heroku


# login
$ heroku login

# logout
- applicationディレクトリごとに実行する必要があるっぽい
$ heroku logout

# create application1
- ディレクトリでログイン後、createコマンドを実行することでgit remoteにherokuが設定される
- application_nameを省略するとランダムな名前が付けられる
$ heroku create [application_name]

- Buildpacks: https://devcenter.heroku.com/articles/buildpacks#officially-supported-buildpacks
- buildパックを指定
$ heroku create <application_name> --buildpack <build_pack>
$ heroku create myapp --buildpack heroku/python

# set build pack
$ heroku buildpacks:set <build_pack>
$ heroku buildpacks:set heroku/php

# deploy
$ git push heroku master

# open by browser
$ heroku open

# show environment
$ heroku config

# set environment
$ heroku config:set <ENVRONMENT_BALIABLE>='xxxx'

# show heroku tools
$ heroku addons

# add heroku tool
- ClearDBをaddonしたい場合
$ heroku addons:create cleardb:ignite

# show log
$ heroku logs

# show realtime logs
$ heroku logs -t
$ heroku logs - tail

# confirm domain
$ heroku domains

# list heroku application
$ heroku apps
$ heroku list

# run heroku command
$ heroku run <command>

- heroku管理画面のRun Consoleからも操作ができる
$ <command>

# rename heroku application inside application directory
$ heroku rename <new_name>

# rename heroku applicaton outside application directory
$ heroku rename <new_name> --app <old_name>