Reputation: 63
I decided to build my pipeline on this plan:
docker:latest
, and builds a test-ready container (pytest, lint) and pushes it to the local registry.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
Upvotes: 0
Views: 603
Reputation: 63
You don't need to use CI_PROJECT_DIR
. Save your code in another directory:
/my-app
for example.
And in your second stage use cd /my-app
.
Code example of your second stage:
test:
stage: test
tags:
- test
before_script:
- cd /my-app
script:
- pwd
- ls -lah
Upvotes: 1