Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku specify which app to run command on?

In my git repo I have added two different heroku remotes to separate apps (named testheroku and officialheroku).

I am able to push to them separately by specifying their remote name (i.e. git push officialheroku master) but when try to use heroku run python manage.py syncdb it only runs syncdb for testheroku.

How do I make heroku run syncdb on officialheroku?

like image 674
bab Avatar asked Jun 12 '13 21:06

bab


People also ask

How do I change heroku Run command?

Running Commands on the Heroku Web Interface To use the web console, navigate to your application in Heroku. The same application that you would pass into --app earlier. In the top-right of the interface, there is a “More” button, pressing it displays a “Run Console” option. Select it to add your command.

Where do heroku commands run?

The Heroku Dashboard now supports heroku run from the App Actions menu. Navigate to your Heroku app to use the App Actions menu.


3 Answers

From the Heroku docs:

heroku run python manage.py syncdb --app officialheroku

As an FYI, the general usage syntax from the CLI is as follows:

heroku COMMAND [--app APP] [command-specific-options]
like image 167
zeantsoi Avatar answered Oct 23 '22 10:10

zeantsoi


There are two ways to do this:

  • heroku --app heroku_app_name (where the app name is the foo part in foo.herokuapp.com)
  • heroku --remote git_remote_name (where the remote name is one of the items that shows up in the list when you run git remote)
like image 27
georgebrock Avatar answered Oct 23 '22 09:10

georgebrock


If you want to use the git remote names you've defined in the CLI you pass it explicitly using the -r parameter

heroku run python manage.py syncdb -r testheroku|officialheroku
like image 26
John Beynon Avatar answered Oct 23 '22 09:10

John Beynon