gitlab - 未显示作业工件

标签 gitlab gitlab-ci gitlab-ci-runner

我正在使用自托管的 gitlab 版本 14.10 以及使用 docker 执行器自注册的 gitlab 运行程序。在这张图片中,我正在使用 gitlab 的 secret 检测作业 template它生成工件 gl-secret-detection-report.json 并且似乎将其上传回某种协调器(我想知道这是什么),但不幸的是我仍然看不到它我在此页面的作业工件部分。

我检查过this问题看起来很相似,但事实并非如此,我还检查了 GitLab 的文档,没有发现与我的问题类似的内容。

enter image description here

我什至在管道页面的作业列表中看不到工件列:

enter image description here

最佳答案

好的,我找到答案了 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/

相关文章:

latex - 使用 GitLab CI 编译多个 LaTeX 文件

git - 如何在 GitLab 中创建里程碑

node.js - Nodegit https 身份验证

gitlab - 如何在 gitlab 中包含另一个存储库中的文件夹

git - 是否可以在 gitlab-ci 中将另一个分支构建到另一个目录?

continuous-integration - 此作业卡住了,因为该项目没有在线分配任何运行者。进入运行者页面

java - 如何使用 GitLab runner 运行 spring-boot 应用程序?

git - 从本地 git 服务器推送到 gitlab

ruby-on-rails - 如何配置 nginx 以在 SubURI 上提供 gitlabhq

gitlab - 在 gitlab-ci 中尝试上传之前记录工件存档的大小