0

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?

James Thomas
  • 4,303
  • 1
  • 20
  • 26

1 Answers1

3

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 ...
James Thomas
  • 4,303
  • 1
  • 20
  • 26