Heroku specify which app to run command on?
Asked Answered
C

3

8

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?

Cingulum answered 12/6, 2013 at 21:34 Comment(0)
O
26

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]
Oldenburg answered 12/6, 2013 at 21:36 Comment(0)
S
3

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)
Stonge answered 12/6, 2013 at 22:8 Comment(1)
@AswinKumar You still need the Heroku command, e.g. heroku --app heroku_app_name run python manage.py syncdbStonge
S
1

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
Squamous answered 12/6, 2013 at 21:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.