New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move convox switch client side #691
Conversation
Testing this... I see some regressions and surprises:
|
seems like a fair trade-off to me 😄 |
Can't wait for this to be released 👍 :) |
This is causing no end of issued for me when we have multiple builds running and then deploying from the CLI on CircleCI. Sometimes mid deploy the rack will switch so the app will not deploy cleanly or build (or it will build but not promote the build). |
Picking this up again, and on second review I think it's pretty close as-is |
I think the order of precedence for CONVOX_RACK is incorrect. It should take override ~/.convox/rack as an explicit default for the current terminal session. |
+1 |
Rebased and changed the precedence. In testing I think that CONVOX_RACK should also override This could still use:
|
Demo - Switch Command$ rm ~/.convox/rack
$ convox switch
Use `convox racks` to list your available racks and `convox switch <rack>` to select one.
$ convox switch foo
ERROR: Rack not found. Try one of:
convox/staging running
convox/demo running
convox/production running
personal/dev-east running
personal/staging running
$ convox switch dev-east
Switched to personal/dev-east
$ convox switch
personal/dev-east
$ convox apps
APP STATUS
httpd running
httpd-old running
rails running
$ convox switch staging
ERROR: You have access to multiple racks with that name, try one of the following:
convox/staging
personal/staging
$ convox switch personal/staging
Switched to personal/staging
$ convox switch convox/staging
Switched to convox/staging Demo - --rack flag$ convox apps --help
convox apps: list deployed apps
Usage:
convox apps <command> [args...]
Subcommands: (convox apps help <subcommand>)
create create a new application
delete delete an application
info see info about an app
params list advanced parameters for an app
help, h
Options:
--rack value, -r value Rack name. Inferred from CONVOX_RACK, ./convox/rack or ~/.convox/rack if not specified.
--help, -h show help
$ convox switch
convox/staging
$ convox apps
APP STATUS
console-staging running
site-staging running
$ convox apps --rack dev-east
APP STATUS
httpd running
httpd-old running
rails running
$ convox apps -r dev-east
APP STATUS
httpd running
httpd-old running
rails running Demo - CONVOX_RACK env var$ convox switch
convox/staging
$ convox apps
APP STATUS
console-staging running
site-staging running
$ CONVOX_RACK=dev-east convox apps
APP STATUS
httpd running
httpd-old running
rails running Demo -- ./convox/rack file$ cd httpd
$ convox switch
convox/staging
$ convox builds
ERROR: no such app: httpd
$ mkdir .convox
$ echo personal/dev-east > .convox/rack
$ convox builds
ID STATUS RELEASE STARTED ELAPSED DESC
BVFZQPTJJNV complete RTAYZHUSGCJ 1 week ago 22s
$ convox builds --rack convox/staging
ERROR: no such app: httpd
$ CONVOX_RACK=convox/staging convox builds
ERROR: no such app: httpd |
I noticed when logging into my local dev rack from Console,
|
Trying to think about what the |
On second thought... I don't think we need to change I don't think too many people are moving between console and a single rack other than for development. So as long as the behavior is coherent for those of us logged into console its a big improvement. |
Latest changes lgtm 👍 |
This needs documentation. A PS1 helper would be very nice too |
reads current rack from (in order): --rack (not added to commands yet) ./convox/rack ~/.convox/rack $CONVOX_RACK
…X_RACK takes precedence over prior app or switch setting
+1 for a PS1 helper.. the question comes up every once in a while and I provide my hacked version using the API. :) |
Docs are here: https://github.com/convox/site/pull/177 |
reads current rack from (in order):
convox switch
now returns the current rack nameconvox switch <rack>
now updates~/.convox/rack
CLI Release Playbook