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:
parent
e4ae60d336
commit
46b1ad0278
1 changed files with 20 additions and 0 deletions
20
.gitlab-ci.yml
Normal file
20
.gitlab-ci.yml
Normal 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/
|
||||
|
Loading…
Reference in a new issue