【发布时间】:2021-12-15 23:07:57
【问题描述】:
我正在使用 Go 微服务,我需要在其中解析 Newman 报告。目前,我正在从本地目录中获取 Newman 报告,如下所示:
jsonFile, err := os.Open("outputfile.json")
if err != nil {
fmt.Println(err)
}
但我需要在 Gitlab CI 中生成报告如下:
image:
name: postman/newman
entrypoint: [""]
script:
- echo "Generating newman report"
- pwd
- newman --version
- newman run collection.json --reporters cli,json --reporter-json-export outputfile.json
artifacts:
paths:
- outputfile.json
有什么方法可以使用来自 GitLab CI 的报告(可能使用 CURL)并将报告作为 API 驱动的输入,而不是从本地目录中获取?
【问题讨论】:
-
可以使用 Artifacts API docs.gitlab.com/ee/api/job_artifacts.html