Enhance Jenkinsfile to handle multiple requirements files. Added conditional checks to install dependencies from either requirements.txt or base.txt, with error handling for missing files.
This commit is contained in:
11
Jenkinsfile
vendored
11
Jenkinsfile
vendored
@@ -94,7 +94,16 @@ pipeline {
|
||||
set -euxo pipefail
|
||||
python --version
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r /workspace/backend/requirements.txt
|
||||
if [ -f /workspace/backend/requirements.txt ]; then
|
||||
pip install -r /workspace/backend/requirements.txt
|
||||
elif [ -f /workspace/backend/requirements/base.txt ]; then
|
||||
pip install -r /workspace/backend/requirements/base.txt
|
||||
else
|
||||
echo "ERROR: No requirements file found in /workspace/backend"
|
||||
ls -la /workspace/backend || true
|
||||
ls -la /workspace/backend/requirements || true
|
||||
exit 1
|
||||
fi
|
||||
cd /workspace/backend
|
||||
alembic upgrade head
|
||||
pytest -q tests -v -ra -s
|
||||
|
||||
Reference in New Issue
Block a user