首页 > 解决方案 > 如何将黑鸭与 gitlab-ci 集成

问题描述

我们如何将 Black Duck 许可证扫描与 gitlab-ci 集成:

$ bash <(curl -s -L https://detect.synopsys.com/detect.sh)
Detect Shell Script 
Detect Shell Script 2.4.0
Will look for : https://sig-repo.synopsys.com/bds-integrations-release/com/synopsys/integration/synopsys-detect/6.5.0/synopsys-detect-6.5.0.jar
You have already downloaded the latest file, so the local file will be used.
Java Source: PATH
running Detect: "java"  -jar "/root/synopsys-detect/download/synopsys-detect-6.5.0.jar" 
______     _            _
|  _  \   | |          | |
| | | |___| |_ ___  ___| |_
| | | / _ \ __/ _ \/ __| __|
| |/ /  __/ ||  __/ (__| |_
|___/ \___|\__\___|\___|\__|

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (jar:file:/root/synopsys-detect/download/synopsys-detect-6.5.0.jar!/BOOT-INF/lib/groovy-all-2.4.12.jar!/) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Detect Version: 6.5.0

2020-09-08 11:16:06 INFO  [main] --- 
2020-09-08 11:16:06 INFO  [main] --- Current property values:
2020-09-08 11:16:06 INFO  [main] --- --property = value [notes]
2020-09-08 11:16:06 INFO  [main] --- ------------------------------------------------------------
2020-09-08 11:16:06 INFO  [main] --- ------------------------------------------------------------
2020-09-08 11:16:06 INFO  [main] --- 
2020-09-08 11:16:06 INFO  [main] --- Tilde's will be automatically resolved to USER HOME.
2020-09-08 11:16:06 INFO  [main] --- Source directory: /home/siddharth.sharma2
2020-09-08 11:16:06 INFO  [main] --- Output directory: /root/blackduck
2020-09-08 11:16:06 INFO  [main] --- Run directory: /root/blackduck/runs/2020-09-08-05-46-05-916
2020-09-08 11:16:06 INFO  [main] --- 
2020-09-08 11:16:06 ERROR [main] --- Your environment was not sufficiently configured to run Black Duck or Polaris. Please configure your environment for at least one product.
2020-09-08 11:16:06 INFO  [main] --- 
2020-09-08 11:16:06 INFO  [main] --- Creating status file: /root/blackduck/runs/2020-09-08-05-46-05-916/status/status.json
2020-09-08 11:16:06 INFO  [main] --- Status file has been deleted.  To preserve status file, turn off cleanup actions.
2020-09-08 11:16:06 INFO  [main] --- Cleaning up directory: /root/blackduck/runs/2020-09-08-05-46-05-916
2020-09-08 11:16:06 INFO  [main] --- 
2020-09-08 11:16:06 INFO  [main] --- 
2020-09-08 11:16:06 INFO  [main] --- ======== Detect Issues ========
2020-09-08 11:16:06 INFO  [main] --- 
2020-09-08 11:16:06 INFO  [main] --- EXCEPTIONS:
2020-09-08 11:16:06 INFO  [main] ---    Your environment was not sufficiently configured to run Black Duck or Polaris. Please configure your environment for at least one product.
2020-09-08 11:16:06 INFO  [main] --- 
2020-09-08 11:16:06 INFO  [main] --- ======== Detect Status ========
2020-09-08 11:16:06 INFO  [main] --- 
2020-09-08 11:16:06 INFO  [main] --- Overall Status: FAILURE_CONFIGURATION - Detect was unable to start due to issues with it's configuration. Check and fix your configuration.
2020-09-08 11:16:06 INFO  [main] --- 
2020-09-08 11:16:06 INFO  [main] --- ===============================
2020-09-08 11:16:06 INFO  [main] --- 
2020-09-08 11:16:06 INFO  [main] --- Detect duration: 00h 00m 01s 034ms`enter code here`
2020-09-08 11:16:06 ERROR [main] --- Exiting with code 7 - FAILURE_CONFIGURATION
Result code of 7, exiting

我只是通过获取 detect.sh 文件进行了尝试,也没有文档可用于将黑鸭许可证扫描与 gitlab-ci 集成

标签: gitlab-ci

解决方案


--detect.source.path 试试

bash <(curl -s -L https://detect.synopsys.com/detect.sh) --blackduck.url=<your_blackduck_server_url --blackduck.api.token=<your_api_token> --detect.source.path=<source_folder_to_scan> 

获取调试输出

--logging.level.com.synopsys.integration=DEBUG

我收到“环境配置不充分”错误,因为我没有添加 blackduck.url。

cli 工具在 -h/--help 上不显示完整帮助或未给出适当参数时的奇怪行为。


推荐阅读