Loading...

Node.js Auto DevOps jobs

For a full list of the Node.js-optimized Auto DevOps jobs, visit Node.js-optimized Auto DevOps 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

Basic Frontend Hosting

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: "./"

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

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.

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.

NPM Check job

The NPM Check job assesses outdated, incorrect, and unused dependencies. For more information, visit the documentation for the npm-check package.

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.

NPM ESLint job

The NPM ESLint job performs a static analysis of the code by using ESLint. 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.

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.

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.

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.

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 BuildArtifacts in the navigation bar.

For more information, visit Static Application Security Testing (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 BuildArtifacts in the navigation bar. For more information, visit 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.

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation
Back to Site navigation