---
title: "Using environment variables"
date: "2024-12-30T11:52:01+00:00"
summary: "Customize your Code Studio pipeline with environment variables to override defaults, enable/disable jobs, and set specific parameters for CI/CD."
image:
type: "page"
url: "/acquia-cloud-platform/add-ons/code-studio/using-environment-variables"
id: "2193b625-e0f7-45b9-9168-bea865467d7d"
---

Table of contents will be added

The Code Studio pipeline is ready-for-use and out-of-the-box. Additionally, it can be customized to fit the needs of different projects.

You can use environment variables to:

*   Override default values of the CI/CD pipeline
*   Enable or disable specific jobs
*   Set custom or specific parameters for the CI/CD pipeline
    
    For example, you can set an environment variable so that the pipeline is aware of the PHP version in your repository.
    

### Adding environment variables

1.  Click **Settings** > **CI/CD**.
2.  In the Variables section, click **Expand** and then click **Add variable**.
3.  In the Add variable dialog box, specify the appropriate value in each field.
4.  Click **Add variable**.

You can also add environment variables through the `.gitlab-ci.yml` file.

For example:

    include:
      - project: 'acquia/standard-template'
        file:
         - '/gitlab-ci/Auto-DevOps.acquia.gitlab-ci.yml'
    variables:
      - ACQUIA_JOBS_CREATE_CDE: "true"                                                

Note

Acquia recommends that you add environment variables through the Code Studio UI. Variables that are added through the Code Studio UI take higher precedence than variables that are defined in a `.gitlab-ci.yml` file. Variables that are defined in a `.gitlab-ci.yml` file might not work as expected.

### Modifying environment variables

1.  Click **Settings** > **CI/CD**.
2.  In the Variables section, click **Expand** and then click the pencil icon next to the environment variable that you want to edit.
3.  In the Update variable dialog box, change the value of the environment variable.
    *   To configure the environment variables in order to enable or disable a CI/CD job, see [Environment variables to enable or disable a CI/CD job](#section-using-environment-variables-to-enable-or-disable-a-cicd-job).
    *   To configure other environment variables, see [Other environment variables](#section-using-environment-variables-to-enable-or-disable-a-cicd-job).
4.  Click **Update variable**.

You can also edit environment variables through the `.gitlab-ci.yml` file.

For example:

    include:
      - project: 'acquia/standard-template'
        file:
         - '/gitlab-ci/Auto-DevOps.acquia.gitlab-ci.yml'
    variables:
       - ACQUIA_JOBS_CREATE_CDE: "false"

Note

Acquia recommends that you modify environment variables through the Code Studio UI. Variables defined through the Code Studio UI take higher precedence than variables defined in a `.gitlab-ci.yml` file. Variables defined in a `.gitlab-ci.yml` file might not work as expected.

### Using environment variables to enable or disable a CI/CD job

Environment variables to enable or disable a CI/CD job in Drupal Auto DevOps Environment variables to enable or disable a CI/CD job in Node.js Auto DevOps

**Environment variable name**

**Description**

**Default value**

`ACQUIA_JOBS_TEST_DRUPAL`

Enables or disables the [Test Drupal job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job") of [Test Drupal stage](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-stage "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-stage") of the [Auto DevOps pipeline](/acquia-cloud-platform/add-ons/code-studio/drupal-auto-devops "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing/autodevops-jobs").

When set to `true`, the [Test Drupal job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job") executes.

`true`

`ACQUIA_JOBS_CREATE_CDE`

Enables or disables the [Acquia Continuous Delivery Environment (CDE)](/acquia-cloud-platform/features/cd) creation during the [Deploy Drupal stage](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-deploy-drupal-stage).

When set to `true`, this creates an [Acquia CDE](/acquia-cloud-platform/features/cd) during the [merge process](/acquia-cloud-platform/add-ons/code-studio/docs/dev-workflow#section-creating-a-merge-request-to-propose-a-new-change) for [Automatic Updates](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-automatic-updates-stage).

Note

*   You must have an [Acquia Cloud CD](/acquia-cloud-platform/features/cd) entitlement for this feature to work with Code Studio.
*   Site Factory does not support CDEs. Set this variable to `false` when using a Site Factory application with Code Studio.

`true`

`ACQUIA_JOBS_DEPRECATED_UPDATE`

Enables or disables the [Deprecated Code Update job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-deprecated-code-update-job) of [Automatic Updates](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-automatic-updates-stage).

When set to `true`, the [Deprecated Code Update job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-deprecated-code-update-job) runs at the scheduled time.

`true`

`ACQUIA_JOBS_COMPOSER_UPDATE`

Enables or disables the [Composer Update job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-composer-update-job) of [Automatic Updates](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-automatic-updates-stage).

When set to `true`, the [Composer Update job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-composer-update-job) runs at the scheduled time.

`true`

`ACQUIA_JOBS_VALIDATE_CODE`

Enables or disables the [Validate Code Structure job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-validate-code-structure-job) of the [Auto DevOps pipeline](/acquia-cloud-platform/add-ons/code-studio/drupal-auto-devops "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing/autodevops-jobs").

When set to `true`, the [Validate Code Structure job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-validate-code-structure-job) executes.

`true`

`ACQUIA_TASKS_SETUP_DRUPAL`

Ensures that the Drupal site is set up when the `composer install` command is run during the following jobs:

*   The [Composer Update job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-composer-update-job) of the [Automatic Updates stage](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-automatic-updates-stage)
*   The [Test Drupal job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job") of the [Test Drupal stage](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-stage "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-stage")

If you enable the Drupal setup, Code Studio runs `drush site:install`, and imports Drupal configuration if `ACQUIA_TASKS_SETUP_DRUPAL_CONFIG_IMPORT` is set to `true`.

`false`

`ACQUIA_TASKS_SETUP_DRUPAL_CONFIG_IMPORT`

Imports Drupal configuration after the database is created or copied.

This is applicable only when `ACQUIA_TASKS_SETUP_DRUPAL` is set to `true`.

`true`

`ACQUIA_JOBS_CREATE_TAG_ARTIFACT`

Enables Code Studio to push all tags to Cloud Platform during the [Deploy Drupal stage](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-deploy-drupal-stage). After Code Studio pushes the tagged release to Cloud Platform, you can select it on any of your Cloud Platform environments.

`true`

`ACQUIA_JOBS_DEPLOY_TAG_ARTIFACT`

Deploys the newly created tag to the specified Cloud Platform environment during the [Deploy Drupal stage](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-deploy-drupal-stage) automatically. This variable is applicable only when `ACQUIA_JOBS_CREATE_TAG_ARTIFACT` is set to `true`.

To specify the Cloud Platform environment where tags must deploy to, set the `ACQUIA_CLOUD_SOURCE_ENVIRONMENT_ID` environment variable. If you do not select any environment ID, Code Studio deploys the tags to your production environment.

For more information about how to enable deploy tags, see [Enabling deploy tags in Code Studio](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-enabling-deploy-tags-in-code-studio).

`false`

`ACQUIA_TASKS_PHPUNIT`

Enables or disables the [PHPUnit](https://phpunit.de/) task during the [Test Drupal job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job") of the [Auto DevOps pipeline](/acquia-cloud-platform/add-ons/code-studio/drupal-auto-devops "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing/autodevops-jobs").

When set to `true`, PHPUnit validates your custom unit tests.

`true`

`ACQUIA_TASKS_PHPCS`

Enables or disables the [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer) task during the [Test Drupal job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job") of the [Auto DevOps pipeline](/acquia-cloud-platform/add-ons/code-studio/drupal-auto-devops "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing/autodevops-jobs").

When set to `true`, PHP Code Sniffer validates your custom code to ensure that the code follows established Drupal coding standards.

`true`

`ACQUIA_TASKS_PHPSTAN`

Enables or disables the [PHPStan](https://phpstan.org/) task during the [Test Drupal job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job") of the [Auto DevOps pipeline](/acquia-cloud-platform/add-ons/code-studio/drupal-auto-devops "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing/autodevops-jobs").

When set to `true`, PHPStan validates your custom code to ensure that the code does not rely on deprecated functions or services.

`true`

`ACQUIA_TASKS_DRUTINY`

Enables or disables the [Drutiny](https://github.com/drutiny/drutiny) task during the [Test Drupal job](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing-code-studio/drupal-auto-devops/autodevops-jobs#section-test-drupal-job") of the [Auto DevOps pipeline](/acquia-cloud-platform/add-ons/code-studio/drupal-auto-devops "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing/autodevops-jobs").

When set to `true`, Drutiny audits and reports the performance and security best practices.

`false`

**Environment variable name**

**Description**

**Default value**

`NODE_HOSTING_TYPE`

Required. Describes the hosting type of Node.js application. Valid values are:  
`basic` - Basic Frontend Hosting or Static Site Generation (SSG) application

`advanced` - Advanced Frontend Hosting, ISR (Incremental Static Regeneration) or Server Side Rendering (SSR) application

`none`

`NODE_JOBS_AUDIT`

Enables `npm audit` to run during the Test stage.

`true`

`NODE_JOBS_BUILD`

Enables the Build stage to run.

`true`

`NPM_JOBS_CHECK`

Enables `npm-check` to run during the Test stage.

`true`

`NODE_JOBS_DEPLOY`

Enables the Deploy stage to run.

`true`

`NODE_JOBS_ESLINT`

Enables `npm eslint` to run during the Test stage.

`true`

`NODE_JOBS_TEST`

Enables the Test stage to run.

`true`

`NODE_TASKS_TEST`

Enables `npm test` to run during the Test stage.

`false`  
  
 

`ACQUIA_JOBS_CREATE_TAG_ARTIFACT`

Enables Code Studio to push all tags to Cloud Platform during the Deploy stage. After Code Studio pushes the tagged release to Cloud Platform, you can select it on any of your Cloud Platform environments.

`true`

`ACQUIA_JOBS_DEPLOY_TAG_ARTIFACT`

Deploys the newly created tag to the specified Cloud Platform environment during the Deploy stage. This variable is applicable only when `ACQUIA_JOBS_CREATE_TAG_ARTIFACT` is set to `true`.

To specify the Cloud Platform environment where tags must deploy to, set the `ACQUIA_CLOUD_SOURCE_ENVIRONMENT_ID` environment variable. If you do not select any environment ID, Code Studio deploys the tags to your production environment.

For more information about enabling deploy tags, see [Enabling deploy tags in Code Studio](/acquia-cloud-platform/add-ons/code-studio/docs/customizing-code-studio/node-js-auto-devops/nodejs-autodevops-jobs#enabling-automatic-deployment).

`false`

`ACQUIA_JOBS_DEPLOY_BRANCH_ARTIFACT`

Deploys the newly created branch to the specified Cloud Platform environment during the Deploy stage. This variable applies only when `NODE_JOBS_DEPLOY` is set to `true`.

To specify the Cloud Platform environment for branch deployment, set the `ACQUIA_CLOUD_BRANCH_DEPLOY_ENV_ID` environment variable. If you do not set an environment ID, Code Studio fails the branch-based deployment step.

The deployment step is skipped if the branch built in Code Studio already exists in the target Cloud Platform environment.

`false`

Other environment variables for Drupal Auto DevOps Other environment variables for Node.js Auto DevOps

**Environment variable name**

**Description**

**Default value**

`ACQUIA_TASKS_SETUP_DRUPAL_STRATEGY`

Determines if Code Studio does either of the following during the [Test Drupal stage](/acquia-cloud-platform/add-ons/code-studio/customizing/autodevops-jobs#test-drupal-stage) and the [Automatic Updates stage](/acquia-cloud-platform/add-ons/code-studio/customizing/autodevops-jobs#automatic-updates-stage):

*   Installs a new Drupal database based on a selected profile
*   Syncs a database from a Cloud Platform environment

The valid values are `install` or `sync`.

*   If you select `install`, you can assign a Drupal profile using the `ACQUIA_TASKS_SETUP_DRUPAL_PROFILE` environment variable. If you do not select any profile, Code Studio selects the the minimal profile. If `ACQUIA_TASKS_SETUP_DRUPAL_CONFIG_IMPORT` is set to `true`, Code Studio imports your Drupal configuration to the new database.
*   If you select `sync`, you can set the `ACQUIA_CLOUD_SOURCE_ENVIRONMENT_ID` and the `ACQUIA_CLOUD_SOURCE_DATABASE_NAME` environment variables. If you do not set these environment variables, Code Studio syncs your first production database. If `ACQUIA_TASKS_SETUP_DRUPAL_CONFIG_IMPORT` is set to `true`, Code Studio imports your Drupal configuration imports to the database after the database is copied.

`install`

`ACQUIA_TASKS_SETUP_DRUPAL_PROFILE`

Specifies the install profile that Code Studio uses to create the Drupal database during the [Test Drupal stage](/acquia-cloud-platform/add-ons/code-studio/customizing/autodevops-jobs#test-drupal-stage) and the [Automatic Updates stage](autodevops-jobs.html#automatic-updates-stage). This variable is applicable only when `ACQUIA_TASKS_SETUP_DRUPAL` is set to `true`, and `ACQUIA_TASKS_SETUP_DRUPAL_STRATEGY` is set to `install`.

`minimal`

`SAST_EXCLUDED_PATHS`

Excludes vulnerabilities from output based on the paths. This is a vulnerability filter from [GitLab](https://docs.gitlab.com/ee/user/application_security/sast/#vulnerability-filters).

All Acquia-managed SAST scan jobs for Drupal run as part of the [Test Drupal stage](/acquia-cloud-platform/add-ons/code-studio/customizing/autodevops-jobs#test-drupal-stage) of the [Auto DevOps pipeline](/acquia-cloud-platform/add-ons/code-studio/drupal-auto-devops "https://docs.acquia.com/acquia-cloud-platform/add-ons/code-studio/customizing/autodevops-jobs").

`spec`, `test`, `tests`, `tmp`, `node_modules`, `vendor`, `contrib`, `core`

`ACQUIA_CLOUD_SOURCE_DATABASE_NAME`

Fetches the database name at run time. This variable is used when the database name is not found.

`null`

`ACQUIA_CLOUD_SOURCE_ENVIRONMENT_ID`

Fetches the environment name at run time. This variable is used when an environment ID variable is not found.

To automatically deploy tags to an environment other than production, set the variable to the environment ID of your target environment. For more information, see [Deploy Drupal stage](/acquia-cloud-platform/add-ons/code-studio/customizing/autodevops-jobs#deploy-drupal-stage).

`null`

`PHP_VERSION`

Fetches the PHP version that the project is running. The valid values are 8.2, 8.3, 8.4 and 8.5. This is a mandatory variable.

`8.3`

`ACQUIA_CODEBASE_UUID`

The UUID of the codebase to be used for the Code Studio project.

`unique identifier for the Acquia codebase`

`ACQUIA_APPLICATION_UUID`

The UUID of the application to be used for the Code Studio project.

`unique identifier for the Acquia application`

`MYSQL_VERSION`

Specifies the MySQL version to be used in the project Valid values: 5.7 and 8.0. This is a mandatory variable.

`8.0(New project)`,  
`5.7 (Existing project)`

**Environment variable name**

**Description**

**Default value**

`SAST_EXCLUDED_PATHS`

A comma-separated list of directories to exclude from the Static Application Security Testing (SAST).

`test, tests, tmp, node_modules`

`SECRET_DETECTION_EXCLUDED_PATHS`

A comma-separated list of directories to exclude from secret detection.

`spec, tmp, node_modules`

`ACQUIA_CLOUD_SOURCE_ENVIRONMENT_ID`

Fetches the environment name at run time. This variable is used when an environment ID variable is not found.

To deploy tags to an environment other than production, set the variable to the environment ID of your target environment.

`null`

`ACQUIA_CLOUD_SOURCE_DATABASE_NAME`

Fetches the database name at run time. This variable is used when the database name is not found.

`null`

`NODE_VERSION`

The Node.js major version that must be used in the pipeline. Valid value is `20` or `22`. This is a mandatory variable.

`null`

`ACQUIA_CLOUD_BRANCH_DEPLOY_ENV_ID`

Fetches the environment name at run time. If you do not set an environment ID, Code Studio fails the branch-based deployment step.

To specify the Cloud Platform environment for branch deployment, set the variable to the environment ID of your target environment.

`null`