When CloudShell Colony deploys your applications, it defines environment variables on the created compute instance, 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 debugging, you must manually simulate them in your debug sessions. To learn more about environment variables, see Using Parameters in Application Scripts.
NOTE: When debugging a Linux VM, make sure to run your scripts as the root user.
To define the environment variables in your debug 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 debug session use of the following command:
[Variable Name]=[Variable Value]