When CloudShell Colony deploys your applications, it defines environment variables on the created compute instances. These variables are available for your scripts during the deployment process.
Environment variables are available only to your deployment process. So for the sake of troubleshooting, you must manually simulate them in your troubleshoot sessions. To learn more about environment variables, see Using Parameters in Application Scripts.
NOTE: When troubleshooting a Linux VM, make sure to run your scripts as the root user.
To define the environment variables in your troubleshoot session on a Linux VM:
- Print the environment variables to a file by adding the following command to the Initialization script:
printenv > /var/log/colony-vars-"$(basename "$BASH_SOURCE" .sh)".txt
The variables are printed to a file located in /var/log/colony-vars-[app name].txt.
- Print the content of the file to get a list of all the environment variables.
- To set the value of the variables, in your troubleshoot session use the following command:
[Variable Name]=[Variable Value]