create – Tạo một app

heroku create sushi
git push heroku master

access – Làm việc nhóm

Quản lý làm việc nhóm

heroku access                     # List
heroku access:add me@xy.com
heroku access:remove me@xy.com

Chuyển cho người sở hữu khác

heroku apps:transfer new@owner.com

logs – Show logs

heroku logs
heroku logs -t      # --tail (stream)
heroku logs -s app  # --source (only on app logs)

releases

heroku releases
heroku releases:info v25
heroku rollback

pg – PostgreSQL

Start a database

heroku addons:add heroku-postgresql

Enable backups

heroku addons:add pgbackups:auto-month

See: Heroku PostgreSQL (devcenter.heroku.com)

config – Environment var configuration

Listing

heroku config        # List
heroku config -s     # List in shell format

Getting

heroku config:get KEY

Setting

heroku config:set KEY=val
heroku config:set KEY1=val KEY2=val ...
heroku config:unset KEY1

apps – Applications

heroku apps                  # list
heroku apps:create [NAME]
heroku apps:destroy --app APP
heroku apps:info
heroku apps:open             # open in browser
heroku apps:rename NEWNAME

maintenance

heroku maintenance:on
heroku maintenance:off

Processes

ps – Quản lý các tiến trình

heroku ps              # list
heroku ps:scale web=1  # spawn more dynos

restart

heroku restart

run – Running tasks

heroku run bash
heroku run console                  # Rails console
heroku run rake assets:precompile

Domains

domains – Tùy chỉnh tên miền

Add both!

heroku domains:add example.com
heroku domains:add www.example.com

Removing

heroku domains:clear
heroku domains:remove example.com

See: Custom domains (devcenter.heroku.com)

Wildcard domains

heroku addons:add wildcard_domains
*.yourdomain.com => heroku.com

Một vài mẹo khác

htpasswd (cho PHP apps)

Tạo một file trong webroot:.htaccess

AuthUserFile /app/www/.htpasswd
AuthType Basic
AuthName "Restricted Access"
Require valid-user

Tạo một file:.htpasswd

$ htpasswd -c .htpasswd [username]
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments