Add GitLab CI configuration for Python environment

Introduced a CI pipeline configuration for the project that sets up a Python environment with version 3.11, installs necessary dependencies, and runs initial project setup steps. This includes performing database migrations and starting a test server to verify deployment readiness by making a health check request. The pipeline defines two stages: 'prepare' for the environment setup and 'test' for validating the operational status of the app. It ensures that all commits pushed to the repository maintain a consistent quality and functionality before merging.
This commit is contained in:
Kumi 2024-02-04 09:06:28 +01:00
parent e4ae60d336
commit 46b1ad0278
Signed by: kumi
GPG key ID: ECBCC9082395383F

20
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,20 @@
image: python:3.11
stages:
- prepare
- test
prepare:
stage: prepare
script:
- python -V
- pip install -r requirements.txt
test:
stage: test
script:
- python manage.py migrate --noinput
- python manage.py runserver 0.0.0.0:8000 &
- sleep 5
- curl --fail http://localhost:8000/