1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

testing pipe2

This commit is contained in:
MoonTestUse1
2025-01-06 05:26:31 +06:00
parent 2f7bf9c28c
commit cfedb346d4
5 changed files with 107 additions and 50 deletions

73
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,73 @@
image: python:3.11
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.pip-cache"
cache:
paths:
- .pip-cache/
- backend/venv/
stages:
- test
- build
- deploy
before_script:
- python -V
- python -m venv backend/venv
- source backend/venv/bin/activate
- pip install --upgrade pip
test:
stage: test
services:
- redis:latest
- postgres:15
variables:
POSTGRES_DB: app
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/app
REDIS_HOST: redis
script:
- cd backend
- pip install -r requirements.txt
- pytest -v
only:
- main
- merge_requests
lint:
stage: test
script:
- cd backend
- pip install flake8
- flake8 .
only:
- main
- merge_requests
build:
stage: build
script:
- cd backend
- pip install -r requirements.txt
- echo "Building application..."
- python -c "import sys; print(sys.version)"
artifacts:
paths:
- backend/
only:
- main
deploy:
stage: deploy
script:
- echo "Deploying application..."
- cd backend
- alembic upgrade head
environment:
name: production
only:
- main

View File

@@ -1,2 +1,11 @@
# AdministrationItDepartmens
Site for teh support
# Administration Project
[![pipeline status](https://gitlab.com/mysite7215201/Administration/badges/main/pipeline.svg)](https://gitlab.com/mysite7215201/Administration/-/commits/main)
## Description
Project for managing administrative tasks
## CI/CD Status
- Last test run: Pending
- Build status: Pending
- Deploy status: Pending

View File

@@ -1,60 +1,40 @@
version: '3.8'
services:
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- frontend
- backend
restart: always
frontend:
container_name: support-frontend
build:
context: .
dockerfile: docker/frontend/Dockerfile
volumes:
- ./frontend:/app
- /app/node_modules
environment:
- NODE_ENV=development
- VITE_API_URL=/api
depends_on:
- backend
backend:
container_name: support-backend
build:
context: .
dockerfile: docker/backend/Dockerfile
volumes:
- ./backend:/app
image: ${CI_REGISTRY_IMAGE}/backend:latest
restart: always
environment:
- DATABASE_URL=postgresql://postgres:postgres123@db:5432/support_db
- REDIS_URL=redis://redis:6379/0
- DATABASE_URL=postgresql://postgres:postgres@db:5432/app
- REDIS_HOST=redis
- REDIS_PORT=6379
- SECRET_KEY=${SECRET_KEY}
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
depends_on:
- db
- redis
frontend:
image: ${CI_REGISTRY_IMAGE}/frontend:latest
restart: always
ports:
- "80:80"
depends_on:
- backend
db:
container_name: support-db
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres123
- POSTGRES_DB=support_db
ports:
- "5432:5432"
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=app
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
container_name: support-redis
image: redis:alpine
image: redis:latest
restart: always
volumes:
- redis_data:/data

View File

@@ -15,7 +15,7 @@
</router-link>
<router-link
to="/admin"
to="/admin/login"
class="block w-full py-3 px-4 text-center text-indigo-700 bg-indigo-100 hover:bg-indigo-200 rounded-lg transition-colors duration-200 font-medium border-2 border-indigo-200"
>
Вход для администраторов

View File

@@ -1,5 +0,0 @@
62552a1 (HEAD -> test) dd
26b09c0 test2
8fde7f1 (origin/test) test
787d195 (websoc) тестd32123322вд
7399092 тестd32123322в