test after build würde in einer neuen Umgebung auf gitlab-ci @ lauf
Ich habe die folgende Konfiguration als .gitlab-ci.yml, aber ich habe herausgefunden, dass nach dem erfolgreichen Bestehen der Build-Phase (die eine virtuelle Umgebung namens venv erstellen würde) anscheinend in der Testphase eine brandneue Umgebung entsteht (es gibt kein venv-Verzeichnis) überhaupt). Daher frage ich mich, ob ich das Setup-Skript in before_script einfügen soll, damit es in jeder Phase (Build / Test / Deployment) ausgeführt wird. Ist das ein richtiger Weg?
before_script:
- uname -r
types:
- build
- test
- deploy
job_install:
type: build
script:
- apt-get update
- apt-get install -y libncurses5-dev
- apt-get install -y libxml2-dev libxslt1-dev
- apt-get install -y python-dev libffi-dev libssl-dev
- apt-get install -y python-virtualenv
- apt-get install -y python-pip
- virtualenv --no-site-packages venv
- source venv/bin/activate
- pip install -q -r requirements.txt
- ls -al
only:
- master
job_test:
type: test
script:
- ls -al
- source venv/bin/activate
- cp crawler/settings.sample.py crawler/settings.py
- cd crawler
- py.test -s -v
only:
- master
adasd