Configure multiple DCT instances in dct-toolkit
Overview
This page describes a setup for a case where users need to connect to multiple DCT instances via dct-toolkit on a single engine. This would be useful in a case like upgrade testing. The user would upgrade the DCT instance in a lower environment (like a development environment) first, then run test APIs with dct-toolkit. Once all of the tests are successful, the user can upgrade the higher environment (like a production environment) and run checks via dct-toolkit. Being able to switch between DCT instances without hassle can be easily configured in dct-toolkit, as described below.
Example
The user will first need to create separate dct-toolkit configuration files for the environments that need to connect via dct-toolkit. This can be done by using the configFileOutputLocation
option available for the create_config
command:
./dct-toolkit create_config url=https://prod.... api_key=.... configFileOutputLocation=<prod config file path>
./dct-toolkit create_config url=https://dev.... api_key=.... configFileOutputLocation=<dev config file path>
Once the configuration files are created, users can create separate aliases for the config files generated above:
alias dct-toolkit-prod="DCT_TOOLKIT_CONFIG_FILE=<prod config file path>"
alias dct-toolkit-dev="DCT_TOOLKIT_CONFIG_FILE=<dev config file path>"
Once the aliases are set up, users can then switch between production and development environments by invoking the corresponding aliases.
To get sources from the production environment, use the following command:
dct-toolkit-prod
./dct-toolkit get_sources
To get sources from the development environment, use the following command:
dct-toolkit-dev
./dct-toolkit get_sources