BlackDuck Detect exit code 0 failing build

matt_mckinstry's Avatar

matt_mckinstry

23 Jan, 2020 11:17 AM

Hi,
We are trying to run BlackDuck detect using the following

Invoke-RestMethod https://detect.synopsys.com/detect.ps1?$(Get-Random) | iex; detect

Detect runs as it should but it is failing our build with "Command exited with code"

Detect Powershell Script 2.3.0
Checking if Java is installed by asking for version.
Java Source: JAVA_HOME/bin/java=C:\Progra~1\Java\jdk1.8.0/bin/java
Java Standard Output:
Java Error Output: java version "1.8.0_162"
Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
Successfully able to start java and get version.
Initializing Detect folder.
Using system temp folder: C:\Users\appveyor\AppData\Local\Temp\1
Checking for proxy.
Skipping proxy, no host found.
Getting Detect.
Finding latest Detect version.
Using Detect source https://sig-repo.synopsys.com/bds-integrations-release/com/synopsys...
Using Detect Version 6.1.0
Detect jar exists 'False'
You don't have Detect. Downloading now.
Using url https://sig-repo.synopsys.com/bds-integrations-release/com/synopsys...
Downloaded Detect jar successfully 'True'
Executing Detect.
Running Detect: "-jar" "C:\Users\appveyor\AppData\Local\Temp\1/synopsys-detect-6.1.0.jar"
Java Source: JAVA_HOME/bin/java=C:\Progra~1\Java\jdk1.8.0/bin/java
Result code of 0, exiting
Command exited with code

Any ideas how i can make this run without tripping our build?

  1. 1 Posted by matt_mckinstry on 23 Jan, 2020 12:28 PM

    matt_mckinstry's Avatar

    Ive worked around this by:

    Environment variable
    DETECT_EXIT_CODE_PASSTHRU: 1

    $BlackDuckExitCode = 0

    Invoke-RestMethod https://detect.synopsys.com/detect.ps1?$(Get-Random) | iex; $BlackDuckExitCode = detect

    if($BlackDuckExitCode -ne 0) { $host.SetShouldExit($BlackDuckExitCode ) }

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

07 Jul, 2020 06:21 PM
07 Jul, 2020 03:15 PM
05 Jul, 2020 02:33 AM
03 Jul, 2020 07:29 PM
03 Jul, 2020 03:53 AM

 

02 Jul, 2020 09:09 PM
02 Jul, 2020 03:24 PM
01 Jul, 2020 01:12 PM
30 Jun, 2020 04:26 PM
25 Jun, 2020 05:54 PM
24 Jun, 2020 08:11 AM