[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RHC env vars support (call for feedback)



Folks,

We are currently working in supporting list|show|set|unset environment variables from the OpenShift command line tools (rhc). This is initially based in Krishna's (thanks!) pull request[1].

Our first round of discussions about the syntax for these commands was based in Krishna's initial pull request. Sample:

rhc app env-var list -a <myapp>
rhc app env-var add <NAME> <VALUE> -a <myapp>
   rhc app env-var add -n <NAME> -v <VALUE> -a <myapp>
   rhc app env-var add --name <NAME> --value <VALUE> -a <myapp>
rhc app env-var remove <NAME> -a <myapp>
   rhc app env-var remove -n <NAME> -a <myapp>
   rhc app env-var remove --name <NAME> -a <myapp>

Now we are exercising around this initial proposal and trying to evolve it to get closer to the Unix command 'env' syntax (while at the same type keeping our rhc patterns and also allowing env vars to be used in other existing commands like app creation and cartridge addition). So here is where we are currently:

Main command 'rhc app env' with the aliases 'rhc env' and 'rhc app-env'.

rhc app env [list] <myapp>
   rhc app env [list] -a <myapp>
rhc app env [show] <myapp> [-e] <NAME>
   rhc app env [show] [-e] <NAME> -a <myapp>
rhc app env [add|set] <myapp> [-e] <NAME>=<VALUE> [<N>=<V>, ...]
   rhc app env [add|set] [-e] <NAME>=<VALUE> -a <myapp>
rhc app env remove|unset <myapp> [-e] <NAME> [<NAME>, ...]
   rhc app env <myapp> -u <NAME>
   rhc app env <myapp> --unset=<NAME>
   rhc app env remove|unset [-e] <NAME> -a <myapp>
   rhc app env -u <NAME> -a <myapp>
   rhc app env --unset=<NAME> -a <myapp>

Notice that action keywords like list and show are optional, so you could for example list the env vars of an app with 'rhc env myapp' or show the value set for a given env var with 'rhc env myapp VARNAME'. Also the -e would be optional for the rhc app env commands, but could be used in other existing commands to add env vars support, for example:

rhc create-app <myapp> <php-5> -e <NAME>=<VALUE>
   Passes NAME=VALUE to app creation
rhc add-cartridge <mysql-5> -a <myapp> -e <NAME>=<VALUE>
   Passes NAME=VALUE to cartridge addition

What do you think? Please share your feedback about this proposed syntax as we are working on it RIGHT NOW! Env vars support through the REST API will follow.  ;)

Thanks!

Fabiano Franz

[1] https://github.com/openshift/rhc/pull/378


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]