Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Overview

This page provides step-by-step instructions on how to run the Unified Agent from Azure DevOps Services.

Setting Up the Unified Agent Configuration in Your Repository

Download the Unified Agent configuration fileAgent configuration file

Save this file to your local machine.

Edit the includes, archiveIncludes, and archiveExtractionDepth sections of the configuration file to support the relevant file or archive extensions. For more information, see the see the Configuration File & Parameters page.

Upload the modified configuration file to your Azure DevOps Project Repo.Image Removed

...

Browse your file system to select your local version of the Unified Agent configuration file and click Commit.Image Removed

...

Setting up Your Build Pipeline

  1. Go to

...

  1. Pipelines > Builds >  New > New Build Pipeline.

  2. Select the source for your code. You can create a pipeline using YAML (Option 1), or use the classic editor to create a pipeline without YAML (Option 2).

Option 1: Creating a Pipeline Using YAML

  1. In the Where is your code? screen, select a YAML-enabled option.

...

  1. Image Added
  2. In the Select a repository screen, select your repository.

...

  1. Image Added
  2. In Configure your pipeline, select the relevant pipeline configuration.

...

  1. Image Added
  2. In Review your pipeline YAML, add the following text as a post-build step. This activates the WhiteSource integration on your build pipeline.

    Code Block
    - script: 'curl -LJO https://github.com/whitesource/unified-agent-distribution/releases/latest/download/wss-unified-agent.jar'
      displayName: 'Download the latest Unified Agent'
    
    - script: 'java -jar wss-unified-agent.jar -c wss-unified-agent.config -apiKey <API_KEY> -project <PROJECT_NAME>'
      displayName: 'Run Unified Agent Scan'

...

  1. Click Save and run.

Option 2: Creating a Pipeline Without YAML (Classic Editor)

  1. Select the type of repository:

...

  1. Image Added
  2. Select an Empty job:

...

  1. Image Added
  2. Enter a name for the job and select an Agent pool:

...

  1. Image Added
  2. Add the relevant pre-step (Maven, npm install, etc.).

...

  1. Image Added
  2. Add a CLI task in order to download the latest version of the Unified Agent to your local environment.

...

  1. Image Added
  2. Enter the following:

...

iconfalse

...

    • Image Added
  1. Add a CLI task in order to run the Unified Agent using the configuration file you initially downloaded in steps 1 and 2. Make sure you provide a valid API key, product name and project name.

...

iconfalse
    • Display name: Run Unified Agent Scan

    • Script: java -jar wss-unified-agent.jar -c wss-unified-agent.config -apiKey <API_KEY> -product <PRODUCT_NAME> -project <PROJECT_NAME>

...

    • Image Added
  1. Click Save& queue.