diff --git a/README.md b/README.md index b3ec7e0..7ed30ba 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://visualmode.kit.com/newsletter). -_1709 TILs and counting..._ +_1710 TILs and counting..._ See some of the other learning resources I work on: @@ -506,6 +506,7 @@ If you've learned something here, support my efforts writing daily TILs by - [Open Dashboard For Specific Add-On](heroku/open-dashboard-for-specific-add-on.md) - [Run SQL Against Remote Postgres Database](heroku/run-sql-against-remote-postgres-database.md) - [Set And Show Heroku Env Variables](heroku/set-and-show-heroku-env-variables.md) +- [Specify Default Team And App For Project](heroku/specify-default-team-and-app-for-project.md) - [SSH Into Heroku Server Hosting App](heroku/ssh-into-heroku-server-hosting-app.md) ### HTML diff --git a/heroku/specify-default-team-and-app-for-project.md b/heroku/specify-default-team-and-app-for-project.md new file mode 100644 index 0000000..8ab51ee --- /dev/null +++ b/heroku/specify-default-team-and-app-for-project.md @@ -0,0 +1,34 @@ +# Specify Default Team And App For Project + +Typically when you run commands with the Heroku CLI you'll need to specify the +name of the app on Heroku you're targeting with the `--app` flag. However, to +first see the names of the apps you may want to run `heroku apps` (or `heroku +list`). That will list the apps for your default team. + +If you need to see apps for a different team (i.e. organization), you'll need to +specify that team either with the `--team` flag or by setting that as an +environment variable. + +Here I do the latter in an `.envrc` file: + +``` +# Heroku +export HEROKU_ORGANIZATION=visualmode +``` + +Once that is set and the environment reloaded, running `heroku apps` will show +the apps specific to that team on Heroku. + +Similarly, if you want to set a default app for your project so that you don't +have to always specify the `--app` flag, you can update your `.envrc` +accordingly. + +``` +# Heroku +export HEROKU_ORGANIZATION=visualmode +export HEROKU_APP=my-app +``` + +I had a hard time finding official documentation for this which is why I'm +writing this up here. I've manually verified this works with my own team and +app.