We have several different OSE deployments now as we've separated pre-production from production, etc. At first, folks were hand-editing rhc's ~/.openshift/express.conf all the time. Now, folks are doing this as a workaround: 1. Copy your existing .openshift/express.conf to new files, one per environment: cp ~/.openshift/express.conf ~/.openshift/express.conf.dev cp ~/.openshift/express.conf ~/.openshift/express.conf.uat 2. Add these aliases to your ~/.bash_profile: alias rhcd="rhc --config=~/.openshift/express.conf.dev" alias rhcu="rhc --config=~/.openshift/express.conf.uat" 3. Use your new commands (after logging out and back in, so your bash_profile takes effect): # SSH to the UAT security service: rhcu ssh security That's a fine workaround, but I'd like to see "rhc account" get extended with something like "--list" and "--set", where "--list" gave you a one-line list of alternate OpenShift account aliases (such as "dev" and "uat", or "default" for initial default settings). "--set" would let you pick a different alias. "rhc setup" should let you pick an alias for those different configs going forward. So the interaction would be something like:: # rhc account --list default dev uat * prod # rhc account --set prod # rhc account --list default dev uat prod *
You could work around this by setting OPENSHIFT_CONFIG env variable as well: For eg: Make different config file for different account under ~/.openshift/ express.conf dev.conf uat.conf prod.conf export OPENSHIFT_CONFIG=dev&rhc setup will run with the server and account set in dev.conf #export OPENSHIFT_CONFIG= will reset to use default config file.
Our only supported option now is the OPENSHIFT_CONFIG var as Xiaoli notes. I would recommend aliasing that to the account in your shell.