Project Variables
Introduction
Project variables are automatically inherited in all new environments from a specific project. These will be available at runtime, as well as during builds and deploys.
Project variables are unique for the entire project and their values can be overridden both at the environment and component level.
Creating a Project Variable
To create project variables, the first thing you have to do is access the Projects screen:
1. Click on the project name in the upper-right corner of the Bunnyshell interface.
2. Select View all projects.
3. Click on your project's
Settings button.
4. On the left-side menu, click Project variables.
5. Click Create variable.
6. Enter a name and a value and for your variable.
When choosing a name for your variable, make sure you take into account the following requirements:
Variable names should use only alphanumeric characters and the underscore character.
Variable names should not begin with a double underscore.
Variable names should not begin with BNS_.
Variable names cannot contain more than 255 characters.
Variable names cannot contain less than 3 characters.
7. Select the Scope of your variable. The following options are available in the drop-down menu:
Project: Project variables are visible inside the whole project.
Environment: Environment variables are visible for all applications, services and databases inside an environment.
Application: Application variables are visible for all applications inside an environment.
Service: Service variables are visible for all services inside an environment.
Database: Database variables are visible for all databases inside an environment.
8. Choose whether your variable should be a secret one or not. Secrets are encrypted and are only accessible during build and runtime.
9. Finally, click the Create variable button.
Editing or Deleting a Project Variable
1. Go to the Project variables screen.
2. Click the
Options button corresponding to the variable in question.
3. Choose the desired action: Edit or Delete.
Overriding a Project Variable
Environment variables override Project variables.
Component variables override both Project and Environment variables
After being passed to a container, all variables are considered environment variables.
How to override a Project Variable
1. Access the project where you want to override the variable.
2. Select an environment.
3. Click the
Settings button and go to the Environment variables screen.
4. Click the Create variable button.
5. To override the Project Variable, you need to create a new variable with a similar name and a different value. Fill all the fields accordingly, then click Create variable.
1. Access the project where you want to override the variable.
2. Select an environment.
3. Choose a component (application or database) and click its corresponding
Options button. Then select Settings.
4. Access the Variables screen from the left-side menu.
5. Click the Create variable button.
6. To override the Project Variable, you need to create a new variable with a similar name and a different value. Fill all the fields accordingly, then click Create variable.
Last updated
Was this helpful?
