This is a kind of second version of https://gist.github.com/4208338, but in this version you don't need to call projectName_production
or projecName_staging
only production
or staging
.
If you have git remotes called production, staging and development already, then then the only thing you have to do is to source heroku_command_line_wrapper_with_app_name.sh
in your .bash_profile
or .bashrc
:
source /path/to/heroku_command_line_wrapper_with_app_name.sh
or
. heroku_command_line_wrapper_with_app_name.sh
If you want to use your existing git remote names, then create a .herokurc
file and put the following variables on it:
heroku_production_git_remote=name
heroku_staging_git_remote=name
heroku_development_git_remote=name
$ cd /dir/with/a/heroku/app
$ staging logs
$ staging logs -t
$ staging config:get MONGOHQ_URL
$ staging run console
$ production ps
$ production logs -n 3 -p worker.4 -s app -t
You should know the production
, staging
and development
bash functions will be available all over the place, but if you call one of them in directory not containing a heroku application you'll get an error like ! Resource not found
or something like that.