Orkhan M.
Orkhan M.

Reputation: 163

Job artifacts are not shown

I'm using self-hosted gitlab version 14.10 with self-registered gitlab runners using docker executors. In this image I'm using gitlab's secret detection job template and it generates artifact gl-secret-detection-report.json and it seems that it uploads it back to some kind of coordinator (I wonder what is this) but unfortunately I still can't see it in my Job artifacts section at this page.

I've checked this question that seemed to be similar, but its not, I've also checked GitLab's documentation and found nothing similar to my issue.

enter image description here

I even can't see Artifacts column in the Job's list at my Pipeline's page:

enter image description here

Upvotes: 3

Views: 1498

Answers (1)

Orkhan M.
Orkhan M.

Reputation: 163

Okay, I've found the answer here:

To be able to browse the report output files, include the artifacts:paths keyword.

After I've overrided artifacts section for the job it worked fine. There's still no "Artifacts" column in the Job's row at the Pipeline's job list page.

My .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:
    ...

Upvotes: 3

Related Questions