我正在使用自托管的 gitlab 版本 14.10 以及使用 docker 执行器自注册的 gitlab 运行程序。在这张图片中,我正在使用 gitlab 的 secret 检测作业 template它生成工件 gl-secret-detection-report.json
并且似乎将其上传回某种协调器(我想知道这是什么),但不幸的是我仍然看不到它我在此页面的作业工件
部分。
我检查过this问题看起来很相似,但事实并非如此,我还检查了 GitLab 的文档,没有发现与我的问题类似的内容。
我什至在管道页面的作业列表中看不到工件列:
最佳答案
好的,我找到答案了 here :
To be able to browse the report output files, include the artifacts:paths keyword.
在我覆盖了工作的工件部分之后,它工作得很好。管道作业列表页面的作业行中仍然没有“工件”列。
我的.gitlab-ci.yml
:
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
include:
- project: 'devops/gitlab-templates'
ref: master
file: '/lib/gitlab/ci/templates/Docker/Docker-Build-Risky.DO.yml'
- project: 'devops/gitlab-templates'
ref: master
file: '/lib/gitlab/ci/templates/Security/Trivy-Scan.yml'
- template: Security/Secret-Detection.gitlab-ci.yml
- project: 'devops/gitlab-templates'
ref: master
file: '/lib/gitlab/ci/templates/Security/Dive-Scan.yml'
- project: 'devops/gitlab-templates'
ref: master
file: '/lib/gitlab/ci/templates/Docker/Docker-Retag-n-Push.DO.yml'
- project: 'devops/gitlab-templates'
ref: master
file: '/lib/gitlab/ci/templates/Docker/Docker-Retag-n-Push.AWS.yml'
- project: 'devops/gitlab-templates'
ref: master
file: '/lib/gitlab/ci/templates/Docker/Docker-Retag-n-Push.GCP.yml'
- project: 'devops/gitlab-templates'
ref: master
file: '/lib/gitlab/ci/templates/AWS/Deploy.yml'
secret_detection:
variables:
SECRET_DETECTION_HISTORIC_SCAN: "true"
allow_failure: false
artifacts:
reports:
secret_detection: gl-secret-detection-report.json
# this is the way to make artifacts appear
paths:
- gl-secret-detection-report.json
expire_in: 1 day
integration-tests:
stage: test
needs:
- job: "docker-build"
artifacts: true
...
deploy-to-aws:
environment: production
variables:
...
关于gitlab - 未显示作业工件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72569651/