Files
MSE-CyberSec-DevSecOps/.gitlab-ci.yml
Klagarge de8a0ab688 chore(security): remove hardcoded security key
Remove hardcoded security key for flask.
Use environment variable instead.
2025-03-16 15:19:48 +01:00

43 lines
857 B
YAML

stages:
- build
build job:
stage: build
script:
- cd src
- apt-get update -qy
- apt-get install -y python3-dev python3-pip python3.12-venv curl
- python3 -V
# - pip3 install --break-system-packages -r requirements.txt
- curl -sSL https://pdm-project.org/install-pdm.py | python3 -
- export PATH=/root/.local/bin:$PATH
- pdm install
# Set environment variables for the tests
- export FLASK_SECRET_KEY=$FLASK_SECRET_KEY
# launch tests
- export PYTHONPATH=.
- export FLASK_APP=app
- pdm run pytest tests --cov --cov-report term --cov-report html
artifacts:
paths:
- src/htmlcov/
pages:
stage: build
dependencies:
- build job
needs: ["build job"]
script:
- mv src/htmlcov/ public/
artifacts:
paths:
- public
expire_in: 7 days
only:
- main