Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
.github
venv
__pycache__
.pytest_cache
tests
htmlcov
.coverage
.env
docs
*.pyc
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: TaskTracker CI

on:
push:
branches:
- main
- develop
- feature/**
pull_request:
branches:
- main
- develop

jobs:
test:

runs-on: ubuntu-latest

services:
postgres:
image: postgres:16

env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: tasktracker

ports:
- 5432:5432

options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5

env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/tasktracker
APP_PORT: 8000
LOG_LEVEL: INFO

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run Tests
run: |
pytest -v

- name: Generate Coverage Report
run: |
pytest --cov=app --cov-report=term-missing

- name: Build Docker Image
run: |
docker build -t tasktracker:latest .
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.12.10-slim-bookworm AS builder

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt

FROM python:3.12.10-slim-bookworm

RUN useradd -m app

WORKDIR /app

COPY --from=builder /install /usr/local
COPY app ./app

USER app

EXPOSE 8000

CMD ["uvicorn","app.main:app","--host","0.0.0.0","--port","8000"]
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: "3.9"

services:

postgres:
image: postgres:16
container_name: tasktracker-postgres
restart: always
environment:
POSTGRES_DB: tasktracker
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"

api:
build: .
container_name: tasktracker-api
depends_on:
- postgres
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/tasktracker
APP_PORT: 8000
LOG_LEVEL: INFO
ports:
- "8000:8000"
24 changes: 24 additions & 0 deletions docs/pipeline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CI/CD Pipeline Documentation

## Overview

The TaskTracker project uses GitHub Actions for Continuous Integration.

Pipeline executes automatically on:

- Push to feature branches
- Push to develop
- Push to main
- Pull Requests

---

## Pipeline Stages

### 1. Checkout

Downloads repository source code.

```yaml
uses: actions/checkout@v4
```
5 changes: 5 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-r requirements.txt

pytest
pytest-cov
httpx
9 changes: 4 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
fastapi
uvicorn
sqlalchemy
fastapi==0.116.1
uvicorn==0.35.0
sqlalchemy==2.0.41
psycopg2-binary
pydantic
pydantic-settings
python-dotenv
email-validator
pytest
pytest-cov
alembic
pytest-cov
pytest
httpx
Loading