How do I set custom environment variables?

  • Environment Variables (Introduction):

Environment variables stores the values of the frequently used parameters, that are provided to a software program at runtime. Setting and using such placeholders instead of specifying the required values in the application code each time they are needed, makes your application more portable and flexible. It brings even more convenience if these values may differ from one host to another.

Each CloudJiffy-managed software stack is provided with a number of default variables, which display all the significant container information to help developers with application hosting.


CloudJiffy PaaS also gives you the possibility to declare your own custom environment variables (user-defined parameters) by means of adding the needed values to a special configuration file and in such a way, keeping them out of the code. Inside this file, you can set placeholders for your folder names, usernames, passwords, hosts, IP addresses, etc instead of hardcoding their values to every file they are required in.

 

  • Default Environment Variables:

Within variables CloudJiffy provides the data on the created stack. Most of them are just informational (marked within tables below) and do not have any actual effect on the container. For example, using the TOMCAT_VERSION variable you can compare versions of the running Tomcat server and the one required by your application (to ensure compatibility), but changing its value won’t upgrade your container.

 

  • There is a number of options available for all software stack templates as follows:

Variable

Value Example

Description

CLONE_ON_SCALE

FALSE

Defines if new nodes upon horizontal scaling should be clones of a layer master (true) or created from scratch (false)

DOCKER_EXPOSED_PORT

7979,8009,8743,21,22,25,443,80,8080

Lists ports from the EXPOSE directive of the image's dockerfile, which will be opened via container firewall during environment creation (informational)

CLOUDJIFFY_PORTS

3306/tcp, 33061/udp, 33062

Specifies custom ports, which will be opened via container firewall during environment creation

PATH

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

A default shell variable, with a list of paths to directories with executable programs (informational)

STACK_PATH

/opt/tomcat

Stack home directory (informational)

STACK_USER

tomcat

Name of the default user for the stack (informational)

STACK_VERSION

9.0.5

Version of the current template (informational)

MASTER_IP

192.168.4.210

Internal IP address of a master node within a layer (informational)

MASTER_ID

162713

Unique node identifier of a master node within a layer (informational)

MASTER_HOST

node162713

A short hostname for a master node within a layer (informational)

 

 

     To set custom environment variables, follow the below steps:

  1.  
  2. 1. Log in to your Cloudjiffy dashboard.
  3.  
  4. 2. Select the environment where you want to set the custom environment variables.
  5.  
  6. 3. In the configuration settings, you will find a section named "Variables".
  7.  

  1. Click on the "Add" button to add a new custom environment variable.

  1.  
  2. 5. In the "Name" field, enter the name of the environment variable. For example, if you want to set a variable called "ACCEPT_EULA", enter "ACCEPT_EULA" in the "Name" field.
  3.  
  4. 6. In the "Value" field, enter the value for the environment variable. For example, "Y", enter "Y" in the "Value" field.
  5.  
  6. 7. Click on the "Save" button to save the environment variable.

 


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 8280