cli icon indicating copy to clipboard operation
cli copied to clipboard

CloudFouncdy CLI and multitenancy - aliases for environments / deployments

Open kinjelom opened this issue 7 years ago • 2 comments

We have many CF deployments so I think this is a common need to work with many CF deployments :)

I'm looking for a simple way to work with different CF deployments without re-login - something like the BOSH's aliases for environments: https://bosh.io/docs/cli-v2/#env-mgmt

This approach can also be useful when some user wants to work with multiple targets without switching them (on the same CF deployment).

It would by niece to work like this:

cf -e cf1 login -a https://api.cf1.cloud ...
cf -e cf2 login -a https://api.cf2.cloud ...
cf -e cf1 apps
cf -e cf2 apps

Now to get a similar behavior I have to create many customized commands... it is rather a workaround. Example:

  • linux: cf<n> (where <n>=1, 2, ...)
    #!/bin/bash
    export CF_HOME=~/.cf/environments/cf<n>
    mkdir -p $CF_HOME
    export CF_PLUGIN_HOME=~/
    cf "$@"
    
  • windows: cf<n>.cmd (where <n>=1, 2, ...)
    @echo off
    set CF_HOME=%USERPROFILE%\.cf\environments\cf<n>
    if not exist %CF_HOME% mkdir %CF_HOME%
    set CF_PLUGIN_HOME=%USERPROFILE%
    cf %*
    

and after that I can work like this:

cf1 login -a https://api.cf1.cloud ...
cf2 login -a https://api.cf2.cloud ...
cf1 apps
cf2 apps

kinjelom avatar Nov 16 '18 10:11 kinjelom

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/162009005

The labels on this github issue will be updated when the story is started.

cf-gitbot avatar Nov 16 '18 10:11 cf-gitbot

Hi @wildloop many thanks for creating this. This looks like a useful feature we could consider for future development of the CLI. The reason I've mentioned "future" in this context is that the CLI team is currently working on CLI v7 which is primarily focused on adopting CC API V3. At the moment, we are working on a small subset of features for CLI v6 and will be moving efforts for major development including features and enhancements of the CLI to v7 and other future major versions of the CLI.

The effort for CLI v7, as mentioned, is to accelerate the adoption of the CC API V3, which is a current priority. We hope this effort will pay future dividends as development of both the CC API and the CLI will be easier, allowing for more features and enhancements which are/were not currently possible on CC API V2 (and CLI v6). We appreciate your patience during this transition period.

I've added a label to this feature request to track for future consideration. Please also do not hesitate to reach out if you have any questions about any of the above. Happy to go into more details.

abbyachau avatar Nov 26 '18 21:11 abbyachau