Deploying to Production
In this section we’ll discuss the procedure of packaging and readying a Shell for deployment in a production environment. This diagram, that we’ve visited before, illustrates the development flow for Shells:
We’ll be concentrating on the last two phases in the above diagram - creating a distributable package and deploying it to the production server.
Creating a distributable package
To create a distributable package which can be imported to CloudShell, run the following from Command Line, make sure you are in the root directory of the Shell project:
This will create two artifacts in the ‘dist’ sub-folder of the Shell project:
- A zip file archive called <shellname>.zip - This is the Shell distributable package
- A folder named offline_requirements - The Python packages required by the Shell. This folder should be used with any offline execution servers, i.e. execution servers where pip will not be able to reach the internet to download the packages specified in requirements.txt
Configuring offline Execution Servers
Before deploying to the production environment, its important to make sure that all Execution Servers will be able to execute the Shell commands, even if they’re configured to offline access and can’t retrieve the Shell dependencies.
If some of the Execution Servers in your production environment are running in offline mode, simply copy the content of the offline_requirements folder to the offline repository folder. The offline repo folder is defined in the Execution Server customer.config file under PythonOfflineRepositoryPath. For more information on how to configure the offline Execution Server, consult the relevant CloudShell Documentation article.
Deploying to the production CloudShell Server
To deploy the Shell to the production CloudShell server:
- Log in as an administrator.
- Open the Admin menu located on the top of the page, and select Import Package
- Select the Shell zip file created earlier and click Open to import it.
Your Shell should now be ready for use in the production environment.