I decided to build my pipeline on this plan:
- Build stage: Run only if the branch is the main one or one of my build files has been modified. It inherits
docker:latest
, and builds a test-ready container (pytest, lint) and pushes it to the local registry. - Test stage: always runs, inherits the latest or own branch container from the previous stage. All tests are run in it.
- Push to production: it doesn't matter now.
Problems in 2 stage:
I run the ls -la
command and I don't see my venv, node_modules
folders. I thought GIT_CLEAN_FLAGS
would solve my problem. But it didn't help.
How reproduce the problem:
Building image
FROM python:3.7-slim
ARG CI_PROJECT_DIR
WORKDIR $CI_PROJECT_DIR
RUN pip install -r requirements.txt
build:
stage: build
tags:
- build
script:
- docker build --build-arg CI_PROJECT_DIR=$CI_PROJECT_DIR .
Test
lint:
variables:
GIT_CLEAN_FLAGS: none
stage: test
tags:
- test
script:
- pwd
- ls -lah