Versions Compared

Key

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

...


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

...

Bitbucket provides a set of default variables that are available for builds, and can be used in scripts. These variables are detailed in the official Bitbucket documentation. and can be used like below

Sealights PR Parameter
BitBucket Env. Variable
Comment
pullRequestNumberBITBUCKET_PR_ID
latestCommitBITBUCKET_COMMIT
repoUrl BITBUCKET_REPO_SLUGIn some configurations, you may need to prepend the base URL of your repository, like "https://bitbucket.mycompany.int/$BITBUCKET_REPO_SLUG"
targetBranchBITBUCKET_PR_DESTINATION_BRANCHThis is the branch name itself and might need to have a prefix added (Like: "origin/") to match the branch that was provided to SeaLights when scanning the merged branch


Code Block
languagebash
themeEclipse
linenumberstrue
java -jar sl-build-scanner.jar -prConfig -appname "MyApp" -latestCommit $BITBUCKET_COMMIT -pullRequestNumber $BITBUCKET_PR_ID -repoUrl $BITBUCKET_REPO_SLUG -targetBranch origin/$BITBUCKET_PR_DESTINATION_BRANCH -tokenfile sl_acc_token.txt -pi "*co.sealights.sample.*"

Sample of Results on the BitBucket Pull Request page

...