Feedback

Chat Icon

Cloud Native CI/CD with GitLab

From Commit to Production Ready

Managing Artifacts in GitLab CI/CD: Data Sharing Between Jobs
44%

Persisting Data Between Jobs Using Artifacts

We will continue with our previous example.

To pass the flake8.txt file to the report job, we need to use the artifacts keyword in the test job. This is how it is done:

cat <$HOME/todo/app/.gitlab-ci.yml && \
cd $HOME/todo/app && \
git add . && \
git commit -m "Pass artifacts between jobs" && \
git push origin main
image: python:3.12

stages:
  - build
  - test
  - report

build:
  stage: build
  script:
    - pip install -r requirements.txt

test:
  stage: test
  script:
    - pip install -r requirements.txt

Cloud Native CI/CD with GitLab

From Commit to Production Ready

Enroll now to unlock all content and receive all future updates for free.