Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenShift rhc setup using multiple accounts

I have two accounts on Openshift platform. How can I setup my computer so that I can manage both of them with rhc? I cannot find any relevant option in the command line arguments.

like image 304
lunr Avatar asked Apr 16 '13 20:04

lunr


2 Answers

The rhc command-line tools come with the global option -l, --rhlogin LOGIN. You have two options:

  1. Use the -l flag with every command to specify the login name:

    rhc app create <appname> <cartridge> [-l <login1/login2>]
    
  2. Run rhc setup -l LOGIN between the sessions. Once done managing apps from one account you can end the session for it by running rhc account logout.

    rhc setup -l <login1> # First account's login
    rhc app create <appname> <cartridge>
    rhc logout
    rhc setup -l <login2> # Second account's login
    rhc app create <appname> <cartridge>
    rhc logout
    

When you can rhc setup command, the username information gets stored in .openshift/express.conf file; hence the need to run it again when you want to switch the account.

like image 176
Sumana Mehta Avatar answered Oct 24 '22 14:10

Sumana Mehta


The command line also supports --conf - where you pass a file. You can always alias the command via a shell script.

like image 12
Clayton Avatar answered Oct 24 '22 13:10

Clayton