<< PREVIOUS NEXT >>

 

 

NODEJS

 

PREREQUISITES

  1. Install CLI

  2. Node.js version 12.12.0 or higher

  3. Following should be run by the build step

    1. npm install

       

       

       

      NOTE:

      Please make sure package-lock.jsonexists in project root folder. If not please run following command to generate lock file.

       

      npm install --package-lock-only

       

       

    2. npm install -g license-checker

       

       

COMMAND-LINE

 

Run the following from the command line. Recommended to provide project-name else it will be picked up from your maven project's pom.xml.

 

vsp_defense scan --lang=node --api-key=<YOUR_API_KEY>  --path=/d/temp/nodejs-system --project-name="my-nodejs-project"

 

 

 

GITLAB INTEGRATION

 

 

image: node:12.12.0

 

variables:

API_KEY: <YOUR_API_KEY>

 

stages:

  - test

 

runscan:

  stage: test

  script:

  - npm install

  - npm install -g license-checker

  - curl https://raw.githubusercontent.com/CloudDefenseAI/cd/master/latest/cd-latest-linux-x64.tar.gz > /tmp/cd-latest-linux-x64.tar.gz && tar -C /usr/local/bin -xzf /tmp/cd-latest-linux-x64.tar.gz && chmod +x /usr/local/bin/cdefense

    - vsp_defense --lang=node --project-name="Sppp Cicd Sample" --api-key=<YOUR_API_KEY> --path=$PWD

    - echo $?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<< PREVIOUS NEXT >>