From 8caad9268dc01a3e7a344023cf6fb8eaae082f02 Mon Sep 17 00:00:00 2001 From: Topvennie Date: Wed, 3 Apr 2024 10:20:40 +0200 Subject: [PATCH] fix: actions with poetry --- .github/workflows/backend-linting.yaml | 4 +- .github/workflows/backend-tests.yaml | 4 +- backend/pyproject.toml | 1 + development.yml | 158 +++++++++++----------- production.yml | 180 ++++++++++++------------- test.yml | 178 ++++++++++++------------ 6 files changed, 263 insertions(+), 262 deletions(-) diff --git a/.github/workflows/backend-linting.yaml b/.github/workflows/backend-linting.yaml index d145985d..38901c22 100644 --- a/.github/workflows/backend-linting.yaml +++ b/.github/workflows/backend-linting.yaml @@ -19,7 +19,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 - pip install -r ./backend/requirements.txt + pip install poetry + poetry install --directory=./backend - name: Execute linting checks run: flake8 --config ./backend/.flake8 ./backend diff --git a/.github/workflows/backend-tests.yaml b/.github/workflows/backend-tests.yaml index 0d56f627..6cbbb7f5 100644 --- a/.github/workflows/backend-tests.yaml +++ b/.github/workflows/backend-tests.yaml @@ -19,8 +19,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 - pip install -r ./backend/requirements.txt + pip install poetry + poetry install --directory=./backend - name: Compile translations run: django-admin compilemessages - name: Execute tests diff --git a/backend/pyproject.toml b/backend/pyproject.toml index ff23d68c..4dcfceac 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -4,6 +4,7 @@ version = "0.1.0" description = "" authors = ["Topvennie "] readme = "README.md" +package-mode = false [tool.poetry.dependencies] python = "^3.11.4" diff --git a/development.yml b/development.yml index a48dff44..cddc1592 100644 --- a/development.yml +++ b/development.yml @@ -3,94 +3,94 @@ version: "3.9" ############################# NETWORKS networks: - selab_network: - name: selab_network - driver: bridge - ipam: - config: - - subnet: 192.168.90.0/24 + selab_network: + name: selab_network + driver: bridge + ipam: + config: + - subnet: 192.168.90.0/24 ############################# EXTENSIONS x-common-keys-selab: &common-keys-selab - networks: - - selab_network - security_opt: - - no-new-privileges:true - restart: unless-stopped - environment: - TZ: $TZ - PUID: $PUID - PGID: $PGID - env_file: - - .env + networks: + - selab_network + security_opt: + - no-new-privileges:true + restart: unless-stopped + environment: + TZ: $TZ + PUID: $PUID + PGID: $PGID + env_file: + - .env ############################# SERVICES services: - nginx: - <<: *common-keys-selab - image: nginx:latest - container_name: nginx - ports: - - 80:80 - - 443:443 - - 8080:8080 - volumes: - - ${DATA_DIR}/nginx/nginx.dev.conf:/etc/nginx/nginx.conf:ro - - ${SSL_DIR}:/etc/nginx/ssl:ro - depends_on: - - backend - - frontend + nginx: + <<: *common-keys-selab + image: nginx:latest + container_name: nginx + ports: + - 80:80 + - 443:443 + - 8080:8080 + volumes: + - ${DATA_DIR}/nginx/nginx.dev.conf:/etc/nginx/nginx.conf:ro + - ${SSL_DIR}:/etc/nginx/ssl:ro + depends_on: + - backend + - frontend - backend: - <<: *common-keys-selab - container_name: backend - build: - context: $BACKEND_DIR - dockerfile: Dockerfile - command: /bin/bash -c "./setup.sh && python manage.py runsslserver 192.168.90.2:8080" - expose: - - 8080 - volumes: - - ${BACKEND_DIR}:/code + backend: + <<: *common-keys-selab + container_name: backend + build: + context: $BACKEND_DIR + dockerfile: Dockerfile + command: /bin/bash -c "./setup.sh && python manage.py runsslserver 192.168.90.2:8080" + expose: + - 8080 + volumes: + - ${BACKEND_DIR}:/code - celery: - <<: *common-keys-selab - container_name: celery - build: - context: $BACKEND_DIR - dockerfile: Dockerfile.dev - command: celery -A ypovoli worker -l DEBUG - volumes: - - ${BACKEND_DIR}:/code - depends_on: - - backend - - redis + celery: + <<: *common-keys-selab + container_name: celery + build: + context: $BACKEND_DIR + dockerfile: Dockerfile.dev + command: celery -A ypovoli worker -l DEBUG + volumes: + - ${BACKEND_DIR}:/code + depends_on: + - backend + - redis - frontend: - <<: *common-keys-selab - container_name: frontend - build: - context: $FRONTEND_DIR - dockerfile: Dockerfile.dev - command: bash -c "npm install && npm run host" - expose: - - 5173 - volumes: - - ${FRONTEND_DIR}:/app - depends_on: - - backend + frontend: + <<: *common-keys-selab + container_name: frontend + build: + context: $FRONTEND_DIR + dockerfile: Dockerfile.dev + command: bash -c "npm install && npm run host" + expose: + - 5173 + volumes: + - ${FRONTEND_DIR}:/app + depends_on: + - backend - redis: - <<: *common-keys-selab - container_name: redis - image: redis:latest - networks: - selab_network: - ipv4_address: $REDIS_IP - expose: - - $REDIS_PORT - entrypoint: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru - volumes: - - ${DATA_DIR}/redis:/data + redis: + <<: *common-keys-selab + container_name: redis + image: redis:latest + networks: + selab_network: + ipv4_address: $REDIS_IP + expose: + - $REDIS_PORT + entrypoint: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru + volumes: + - ${DATA_DIR}/redis:/data diff --git a/production.yml b/production.yml index 2ab5594f..6abe0fff 100644 --- a/production.yml +++ b/production.yml @@ -3,106 +3,106 @@ version: "3.9" ############################# NETWORKS networks: - selab_network: - name: selab_network - driver: bridge - ipam: - config: - - subnet: 192.168.90.0/24 + selab_network: + name: selab_network + driver: bridge + ipam: + config: + - subnet: 192.168.90.0/24 ############################# EXTENSIONS x-common-keys-selab: &common-keys-selab - networks: - - selab_network - security_opt: - - no-new-privileges:true - restart: unless-stopped - environment: - TZ: $TZ - PUID: $PUID - PGID: $PGID - env_file: - - .env + networks: + - selab_network + security_opt: + - no-new-privileges:true + restart: unless-stopped + environment: + TZ: $TZ + PUID: $PUID + PGID: $PGID + env_file: + - .env ############################# SERVICES services: - nginx: - <<: *common-keys-selab - image: nginx:latest - container_name: nginx - ports: - - 80:80 - - 443:443 - volumes: - - ${DATA_DIR}/nginx/nginx.prod.conf:/etc/nginx/nginx.conf:ro - - ${SSL_DIR}:/etc/nginx/ssl:ro - depends_on: - - backend - - frontend + nginx: + <<: *common-keys-selab + image: nginx:latest + container_name: nginx + ports: + - 80:80 + - 443:443 + volumes: + - ${DATA_DIR}/nginx/nginx.prod.conf:/etc/nginx/nginx.conf:ro + - ${SSL_DIR}:/etc/nginx/ssl:ro + depends_on: + - backend + - frontend - postgres: - <<: *common-keys-selab - image: postgres:15.2 - container_name: postgres - networks: - selab_network: - ipv4_address: $POSTGRES_IP - environment: - POSTGRES_DB: $POSTGRES_DB - POSTGRES_USER: $POSTGRES_USER - POSTGRES_PASSWORD: $POSTGRES_PASSWORD - expose: - - $POSTGRES_PORT - volumes: - - ${DATA_DIR}/postgres:/var/lib/postgresql/data + postgres: + <<: *common-keys-selab + image: postgres:15.2 + container_name: postgres + networks: + selab_network: + ipv4_address: $POSTGRES_IP + environment: + POSTGRES_DB: $POSTGRES_DB + POSTGRES_USER: $POSTGRES_USER + POSTGRES_PASSWORD: $POSTGRES_PASSWORD + expose: + - $POSTGRES_PORT + volumes: + - ${DATA_DIR}/postgres:/var/lib/postgresql/data - backend: - <<: *common-keys-selab - container_name: backend - build: - context: $BACKEND_DIR - dockerfile: Dockerfile - command: bash -c "./setup.sh && gunicorn --config gunicorn_config.py ypovoli.wsgi:application" - expose: - - 8080 - depends_on: - - postgres + backend: + <<: *common-keys-selab + container_name: backend + build: + context: $BACKEND_DIR + dockerfile: Dockerfile + command: bash -c "./setup.sh && gunicorn --config gunicorn_config.py ypovoli.wsgi:application" + expose: + - 8080 + depends_on: + - postgres - redis: - <<: *common-keys-selab - container_name: redis - image: redis:latest - networks: - selab_network: - ipv4_address: $REDIS_IP - expose: - - $REDIS_PORT - entrypoint: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru - volumes: - - ${DATA_DIR}/redis:/data + redis: + <<: *common-keys-selab + container_name: redis + image: redis:latest + networks: + selab_network: + ipv4_address: $REDIS_IP + expose: + - $REDIS_PORT + entrypoint: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru + volumes: + - ${DATA_DIR}/redis:/data - celery: - <<: *common-keys-selab - container_name: celery - build: - context: $BACKEND_DIR - dockerfile: Dockerfile.prod - command: celery -A ypovoli worker -l ERROR - volumes: - - ${BACKEND_DIR}:/code - depends_on: - - backend - - redis + celery: + <<: *common-keys-selab + container_name: celery + build: + context: $BACKEND_DIR + dockerfile: Dockerfile.prod + command: celery -A ypovoli worker -l ERROR + volumes: + - ${BACKEND_DIR}:/code + depends_on: + - backend + - redis - frontend: - <<: *common-keys-selab - container_name: frontend - build: - context: $FRONTEND_DIR - dockerfile: Dockerfile.prod - expose: - - 3000 - depends_on: - - backend + frontend: + <<: *common-keys-selab + container_name: frontend + build: + context: $FRONTEND_DIR + dockerfile: Dockerfile.prod + expose: + - 3000 + depends_on: + - backend diff --git a/test.yml b/test.yml index f8ed370b..ac716c0f 100644 --- a/test.yml +++ b/test.yml @@ -3,105 +3,105 @@ version: "3.9" ############################# NETWORKS networks: - selab_network: - name: selab_network - driver: bridge - ipam: - config: - - subnet: 192.168.90.0/24 + selab_network: + name: selab_network + driver: bridge + ipam: + config: + - subnet: 192.168.90.0/24 ############################# EXTENSIONS x-common-keys-selab: &common-keys-selab - networks: - - selab_network - security_opt: - - no-new-privileges:true - restart: unless-stopped - environment: - TZ: $TZ - PUID: $PUID - PGID: $PGID - env_file: - - .env + networks: + - selab_network + security_opt: + - no-new-privileges:true + restart: unless-stopped + environment: + TZ: $TZ + PUID: $PUID + PGID: $PGID + env_file: + - .env ############################# SERVICES services: - nginx: - <<: *common-keys-selab - image: nginx:latest - container_name: nginx - expose: - - 80 - - 443 - - 8080 - volumes: - - ${DATA_DIR}/nginx/nginx.dev.conf:/etc/nginx/nginx.conf:ro - - ${SSL_DIR}:/etc/nginx/ssl:ro - depends_on: - - backend - - frontend + nginx: + <<: *common-keys-selab + image: nginx:latest + container_name: nginx + expose: + - 80 + - 443 + - 8080 + volumes: + - ${DATA_DIR}/nginx/nginx.dev.conf:/etc/nginx/nginx.conf:ro + - ${SSL_DIR}:/etc/nginx/ssl:ro + depends_on: + - backend + - frontend - backend: - <<: *common-keys-selab - container_name: backend - build: - context: $BACKEND_DIR - dockerfile: Dockerfile - command: /bin/bash -c "./setup.sh && python manage.py runsslserver 192.168.90.2:8080" - expose: - - 8080 - volumes: - - $BACKEND_DIR:/code + backend: + <<: *common-keys-selab + container_name: backend + build: + context: $BACKEND_DIR + dockerfile: Dockerfile + command: /bin/bash -c "./setup.sh && python manage.py runsslserver 192.168.90.2:8080" + expose: + - 8080 + volumes: + - $BACKEND_DIR:/code - celery: - <<: *common-keys-selab - container_name: celery - build: - context: $BACKEND_DIR - dockerfile: Dockerfile.dev - command: celery -A ypovoli worker -l DEBUG - volumes: - - $BACKEND_DIR:/code - depends_on: - - backend - - redis + celery: + <<: *common-keys-selab + container_name: celery + build: + context: $BACKEND_DIR + dockerfile: Dockerfile.dev + command: celery -A ypovoli worker -l DEBUG + volumes: + - $BACKEND_DIR:/code + depends_on: + - backend + - redis - frontend: - <<: *common-keys-selab - container_name: frontend - build: - context: $FRONTEND_DIR - dockerfile: Dockerfile.dev - command: bash -c "npm install && npm run host" - expose: - - 5173 - volumes: - - $FRONTEND_DIR:/app - depends_on: - - backend + frontend: + <<: *common-keys-selab + container_name: frontend + build: + context: $FRONTEND_DIR + dockerfile: Dockerfile.dev + command: bash -c "npm install && npm run host" + expose: + - 5173 + volumes: + - $FRONTEND_DIR:/app + depends_on: + - backend - redis: - <<: *common-keys-selab - container_name: redis - image: redis:latest - networks: - selab_network: - ipv4_address: $REDIS_IP - expose: - - $REDIS_PORT - entrypoint: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru - volumes: - - ${DATA_DIR}/redis:/data + redis: + <<: *common-keys-selab + container_name: redis + image: redis:latest + networks: + selab_network: + ipv4_address: $REDIS_IP + expose: + - $REDIS_PORT + entrypoint: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy allkeys-lru + volumes: + - ${DATA_DIR}/redis:/data - cypress: - <<: *common-keys-selab - container_name: cypress - image: cypress/included:cypress-12.17.3-node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1 - restart: "no" - working_dir: /e2e - volumes: - - ${FRONTEND_DIR}:/e2e - extra_hosts: - - "host.docker.internal:host-gateway" + cypress: + <<: *common-keys-selab + container_name: cypress + image: cypress/included:cypress-12.17.3-node-18.16.0-chrome-114.0.5735.133-1-ff-114.0.2-edge-114.0.1823.51-1 + restart: "no" + working_dir: /e2e + volumes: + - ${FRONTEND_DIR}:/e2e + extra_hosts: + - "host.docker.internal:host-gateway"