In this How-To, we will explore a scenario wherein your organization has set up multiple stages before a bot is finally made available to the end-users for the purpose of bot development, testing, pilot and production release.
Problem Statement
Consider the case wherein the developer has completed the bot development and it needs to be moved to the testing environment for the QA team to access and test the same. The bot definition does not change drastically except for a few environment-specific values.
In this document, we will show how the bot export and import functionality can be used to achieve the same. Refer here for more on Bot Import and Export.
Pre-requisites
- Bot building knowledge
- A fully developed and functional bot. Here we are using the Banking Bot.
Implementation
Step 1 – Export Bot
- In the development environment, open the bot you want to move to the testing environment.
- Select the Deploy tab from the top menu
- From Bot Management, select the Import & Export option.
- Choose the Export tab
- Select the bot components you want to export. The first time you will want to export all components, subsequently, you might want to choose to export only selected components.
- Click Export.
- The bot definition is exported as a ZIP file.
- The file may be used to check the bot definition into your code repository or to attach it to any ticketing system.
Step 2 – Modify config.json
- Any variables that need environment-specific values will be available in the ​config.json​ file present in the exported file.​
- Update these Global Variables (see here for more on Global Variables and here for an example).
- Now the file can be shared with the infrastructure / DevOps teams for initiating deployment in other environments.
- If you have permissions, you can import the bot to the target environment by following the steps given below.
Step 3 – Import Bot
- Extract the files from the zip file exported in the previous step.
- In the testing environment, create a new bot.
- Select the Deploy tab from the top menu
- From Bot Management, select the Import & Export option.
- Choose the Import tab
- Select the Bot Definition File, Bot Config File, and Custom Script File (if any) from the previous step.
- Select the Full Import Import Option. Note that if you are using this option in an existing bot the current bot configurations will be erased and replaced with the imported bot.
- Click Import.
- Your Bot is ready in the testing environment for the QA team to test.
Step 4 – Update Bot
Chances are you need to modify the bot and apply those changes to the bot in the testing environment.
- From the development environment, open the modified bot.
- Select the Deploy tab from the top menu
- From Bot Management, select the Import & Export option.
- Choose the Export tab
- Select the bot components you want to export. You might want to choose to export only modified components.
- Click Export.
- The bot definition is exported as a ZIP file.
- Extract the files from the zip file.
- Change the values for any variables that need environment-specific values in the ​config.json​ file present in the exported file.​
- In the testing environment, open the bot that needs to be updated.
- Select the Deploy tab from the top menu
- From Bot Management, select the Import & Export option.
- Choose the Import tab
- Select the Bot Definition File, Bot Config File, and Custom Script File (if any) from the previous extract step.
- Select the Incremental Import from the Import Option section
- Click Import.
- Your Bot is updated and ready in the testing environment for the QA team to test.