Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page summarizes the agents commands for genrating a pull request specific build session ID and configuration, for the following technologies:

Table of Contents
maxLevel1


Java


Note
  • Minimum Java Agent version supporting prConfig command: 2.1.1166.
  • Recommended version is: latest.



Code Block
languagebash
titleprConfig usage
java -jar sl-build-scanner.jar -prConfig {-token <arg> | -tokenfile <arg>} -appname <arg> -targetBranch <arg> -latestCommit <arg> -pullRequestNumber <arg> -repoUrl <arg> [-pi <arg>] [-pe <arg>]



Parameter
Description
token
Access token generated from the SeaLights server
tokenfile
Path to file containing the access token generated from the SeaLights server
appname 
The name of the app the Pull Request is being merged to (as provided to SeaLights)
targetBranchThe name of the branch the Pull Request is being merged to (as provided to SeaLights)
latestCommit
The latest commit SHA of the Pull Request branch
pullRequestNumber
The Pull Request number that is being evaluated
repoUrl 
The repository URL of the Pull Request and merged branchs 
pi, packagesincluded

Comma-separated list of packages to include in scan

Supports wildcards (* = any string, ? = any character). For example: 'com.example.* ,io.*.demo, com.?ello.world'

pe,packagesexcluded

Comma-separated list of packages to exclude from scan

Supports wildcards (* = any string, ? = any character). For example: 'com.example.* ,io.*.demo, com.?ello.world'

proxy
Address of proxy to run connection through


Info

The packages included and excluded should be exactly the same as what was defined to SeaLights for the merged branch so that the compared results will be the same

Jenkins plugin


NodeJS


Note
  • Minimum slnodejs Agent version supporting prConfig command: 3.5.193.
  • Recommended version is: latest.


Code Block
firstline1
titleUsage
linenumberstrue
./node_modules/.bin/slnodejs prConfig {--token <token> | --tokenfile <file>} --appname <appname> --pullRequestNumber <number> --targetBranch <branchname> --latestCommit <arg> --repositoryUrl <url> [--proxy <proxy>] [--failbuild {true|false}]


ParameterDescription
token
Access token generated from the Sealights server
tokenfile
Path to file containing access token generated from the SeaLights server
appname
The name of the app the Pull Request is being merged to (as provided to SeaLights)
pullRequestNumberThe Pull Request number that is being evaluated
targetBranch
The name of the branch the Pull Request is being merged to (as provided to SeaLights)
latestCommit
The latest commit SHA of the Pull Request branch
repositoryUrlThe repository URL of the Pull Request and merged branchs 
proxy
Address of proxy to run connection through
failbuild
Exit with an error code if an error is encountered (Default: false)

Logging

In order to enable logs you can set the NODE_DEBUG environment variable to one of the following:

ValueDescription
sl
Display log output to the console
sl-file
Export the log information to a log file named 'sl.node.log'

Furthermore, you can set the level of logging by using the SL_LOG_LEVEL environment variable  with one of the following options error, warning, info or debug

Code Block
languagebash
titleSample
export NODE_DEBUG=sl
export SL_LOG_LEVEL=debug