James Thomas
James Thomas

Reputation: 4339

How to use CLI tool with multiple OpenWhisk platform instances?

Developing OpenWhisk applications, I'm often switching between a local instance of the platform for development & testing and IBM Cloud Functions for production.

The OpenWhisk CLI uses a configuration file (~/.wskprops) to store authorisation parameters for the current platform endpoint.

How can I use the CLI tool with different environments without having to manually update the configuration properties each time?

Upvotes: 0

Views: 194

Answers (1)

James Thomas
James Thomas

Reputation: 4339

The OpenWhisk CLI supports overriding the configuration file location using an environment variable (WSK_CONFIG_FILE).

Store platform credentials in separate configuration files and use this environment parameter to choose the platform instance to target.

$ WSK_CONFIG_FILE=~/.wskprops-dev wsk action invoke ...

Upvotes: 3

Related Questions