Sobes.tech
Junior — Middle

Can you explain what artifacts mean in the context of GitLab CI/CD?

sobes.tech AI

Answer from AI

In GitLab CI/CD, artifacts are files or directories created during the execution of a job and saved after its completion. They can be used in subsequent pipeline stages or uploaded for analysis and use outside of CI/CD.

For example, if a binary file or a test report is created during the build stage, these files can be specified as artifacts so they are accessible in later steps or for download from the GitLab interface.

Example in .gitlab-ci.yml:

build_job:
  script:
    - make build
  artifacts:
    paths:
      - build/output_binary
    expire_in: 1 week

Here, after the build_job completes, the file build/output_binary will be saved as an artifact and available for a week.