---
title: "Node.js Auto DevOps jobs"
date: "2024-06-24T07:31:01+00:00"
summary: "Discover Node.js-optimized Auto DevOps jobs for efficient build, test, and deploy stages in Code Studio. Streamline your development workflow."
image:
type: "page"
url: "/acquia-cloud-platform/add-ons/code-studio/nodejs-auto-devops-jobs"
id: "a173e62a-0cff-426c-9454-49fd828f755f"
---

Table of contents will be added

For a full list of the Node.js-optimized Auto DevOps jobs, visit [Node.js-optimized Auto DevOps jobs](#node-optimized-jobs).

### Build stage

#### Build Code job

The Build Code job runs the following commands:

*   `npm install` - to install the dependencies
    
*   `npm run build` - to build the project
    

Note

An `acquia_config.yaml` file must exist at the root of the project.

###### Basic Frontend Hosting

A `package.json` file must be present at the root of the project.

The top-level directory of your project does not need to be kept as the application's root directory. To specify the root directory, add the directory path to the `root_directory` key in the `acquia_config.yaml` or `acquia_config.yml` file:

    root_directory: "./"

Note

*   The default root directory is `<project_root>/`.
    
    The output directory contains the results of a build. To specify the output directory, add the directory path to the `output_directory` section in the `acquia_config.yaml` file of the root directory.
    
*   The default output directory for Frontend Hosting Basic is `<project_root>/out/`.
    
*   For Frontend Hosting Advanced, specify the `output_directory` parameter in your `acquia_config.yaml` file if your application needs an output directory to be generated via the `npm run build` command. When `output_directory` is defined, Code Studio will execute the build process and manage the resulting artifacts . If `output_directory` is not specified, Code Studio assumes build artifacts are not needed and skips the `npm run build` command.
    

By default, Code Studio excludes the following file patterns from the build artifact:

*   `.hg`
*   `.git`
*   `.gitmodules`
*   `.svn`
*   `.cache`
*   `.eslintrc`
*   `.now`
*   `.vercel`
*   `.npmignore`
*   `.dockerignore`
*   `.gitignore`
*   `.*.swp`
*   `.DS_Store`
*   `.wafpicke-*`
*   `.lock-wscript`
*   `.env.local`
*   `.env.*.local`
*   `.venv`
*   `npm-debug.log`
*   `config.gypi`
*   `node_modules`
*   `__pycache__`
*   `venv`
*   `CVS`

Note

Code Studio does not exclude `node_modules` from the build artifacts when it is used with Frontend Hosting Advanced .

This job can be extended to run other necessary build commands. 

#### Manage Secrets job

The Manage Secrets job is responsible for SSH key management.

### Test stage

#### NPM Audit job

The NPM Audit job audits package dependencies for security vulnerabilities. For more information, visit the [npmjs documentation](https://docs.npmjs.com/auditing-package-dependencies-for-security-vulnerabilities).

To disable the job, add the `NODE_JOBS_AUDIT` environment variable in Code Studio and set it to `false`. For more information, visit [Adding environment variables](/acquia-cloud-platform/add-ons/code-studio/customizing-code-studio/default-code-studio-pipeline/environment-variables#section-adding-environment-variables).

#### NPM Check job

The NPM Check job assesses outdated, incorrect, and unused dependencies. For more information, visit the [documentation for the npm-check package](https://www.npmjs.com/package/npm-check).

To disable the job, add the `NPM_JOBS_CHECK` environment variable in Code Studio and set it to `false`. For more information, visit [Adding environment variables](/acquia-cloud-platform/add-ons/code-studio/customizing-code-studio/default-code-studio-pipeline/environment-variables#section-adding-environment-variables).

#### NPM ESLint job

The NPM ESLint job performs a static analysis of the code by using [ESLint](https://eslint.org/). If the root directory of the project already contains a `.eslintrc` file, Code Studio uses this file to determine the ESLint rules. Otherwise, Code Studio uses the default ESLint settings that adhere to the [Standard.js rules](https://standardjs.com/rules.html).

To disable the job, add the `NODE_JOBS_ESLINT` environment variable in Code Studio and set it to `false`. For more information, visit [Adding environment variables](/acquia-cloud-platform/add-ons/code-studio/customizing-code-studio/default-code-studio-pipeline/environment-variables#section-adding-environment-variables).

#### NPM Test job

The NPM Test job runs the predefined test commands. By default, this job is disabled. A predefined command must be specified in the `test` property of the `scripts` object of a package. For more information, visit the [npmjs documentation](https://docs.npmjs.com/cli/v10/commands/npm-test).

To enable the job, add the `NODE_TASKS_TEST` environment variable in Code Studio and set it to `true`. For more information, visit [Adding environment variables](/acquia-cloud-platform/add-ons/code-studio/customizing-code-studio/default-code-studio-pipeline/environment-variables#section-adding-environment-variables).

#### Static Application Security Testing (SAST) jobs

One or more SAST jobs perform a static scan of your code for security vulnerabilities.The number of jobs depends on the types of files committed to your repository. SAST results are saved as job artifacts. To access the SAST results within your Code Studio project, navigate to **Build** > **Artifacts** in the navigation bar.

For more information, visit [Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/).

#### Secrets Detection job

The Secrets Detection job scans your code to ensure that you did not commit secrets, such as login credentials, to your repository. To access the results within your Code Studio project, navigate to **Build** > **Artifacts** in the navigation bar. For more information, visit [Secret Detection](https://docs.gitlab.com/ee/user/application_security/secret_detection/).

### Deploy stage

#### Create artifact from branch and Create artifact from tag jobs

These jobs push the build artifact to Cloud Platform. You can deploy build artifacts to a Cloud Platform environment. Build artifact names use `<branch>-codestudio-build` or `<tag>-codestudio-build`.

#### Enabling automatic deployment of tags in Code Studio

To automate tag deployment to your production environment, set the `ACQUIA_JOBS_DEPLOY_TAG_ARTIFACT` environment variable to `true`. Code Studio then:

1.  Generates a build artifact.
2.  Tags the artifact as `<tag>-codestudio-build`.
3.  Pushes the tag to Cloud Platform.
4.  Deploys the tag to production.

To deploy to an environment other than production, set the `ACQUIA_CLOUD_SOURCE_ENVIRONMENT_ID` variable to the target environment ID.

####   
Enabling automatic deployment of branches in Code Studio

To automate branch deployment to a target environment, set `ACQUIA_JOBS_DEPLOY_BRANCH_ARTIFACT` to `true` and set `ACQUIA_CLOUD_BRANCH_DEPLOY_ENV_ID` to the target environment's ID. Code Studio then:

1.  Generates a build artifact.
2.  Creates a build branch with the naming convention `<branch>-codestudio-build`.
3.  Pushes the branch to Cloud Platform.
4.  Deploys the branch to production.

Branch-based deployments fail if `ACQUIA_CLOUD_BRANCH_DEPLOY_ENV_ID` is not set.

Branch-based deployment is skipped if the branch built in Code Studio already exists in the target Cloud Platform environment.

### Node.js-optimized Auto DevOps jobs

Build

Test

Deploy

Build Code

NPM Audit

Create artifact from branch

Manage Secrets

NPM Check

Create artifact from tag

 

NPM ESLint

Deploy tag artifact to the environment

 

NPM Test

Deploy branch artifact to the environment

 

nodejs-scan-sast

 

 

phpcs-security-audit-sast

 

 

secret\_detection

 

 

semgrep-sast

 

For information about the Node.js Auto DevOps pipeline, visit [Node.js Auto DevOps pipeline steps](https://acquia.widen.net/s/nsbgtdkwjb/code-studio_nodejs-auto-devops).