clever-tools icon indicating copy to clipboard operation
clever-tools copied to clipboard

Make clever-tools configurable for multizone purpose

Open judu opened this issue 5 years ago • 4 comments

We are implementing more and more private/satellite zones. We need to easily configure clever-tools to use another api url.

How could we do that?

judu avatar Sep 25 '19 13:09 judu

what's possible currently is to configure it with environment variables. back in the day, I used direnv to handle that. Having it configured per linked application in .clever.json could be useful

divarvel avatar Sep 25 '19 13:09 divarvel

@judu As @divarvel explained it here and in #410, this is possible via env vars. For example, for preprod, you need:

export API_HOST='https://ccapi-preprod.cleverapps.io/v2';
export CONSOLE_TOKEN_URL='https://next-console.cleverapps.io/cli-oauth';

I tried for par0 and in this case, you also need the OAUTH_CONSUMER_* vars.

export API_HOST='https://.../v2';
export CONSOLE_TOKEN_URL='https://.../cli-oauth';
export OAUTH_CONSUMER_KEY='...';
export OAUTH_CONSUMER_SECRET='...';

hsablonniere avatar May 13 '20 23:05 hsablonniere

@judu Let me know if this is enough for you ;-)

hsablonniere avatar May 14 '20 00:05 hsablonniere

In the long term, we're considering having a config file in ~/config/clevercloud or something like that with on prem zones and their config details so you would be able to use any command with a --zone or an env var.

hsablonniere avatar Jun 18 '20 15:06 hsablonniere