-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feat/create_ambassadors_app
- Loading branch information
Showing
15 changed files
with
149 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
venv | ||
.git | ||
db.sqlite3 | ||
.env | ||
.idea | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,51 @@ | ||
name: Upload coverage reports to Codecov | ||
name: Workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
|
||
jobs: | ||
build: | ||
tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Run tests with coverage | ||
- name: Install dependencies | ||
run: | | ||
pip install coverage | ||
coverage run -m unittest discover | ||
coverage report -m | ||
python -m pip install --upgrade pip | ||
pip install -r requirements_mini.txt | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4.0.1 | ||
- name: Check with flake8 | ||
run: python -m flake8 crm_yandex/ | ||
|
||
build_and_push_to_docker_hub: | ||
name: Push Docker image to DockerHub | ||
runs-on: ubuntu-latest | ||
needs: tests | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Docker | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Push to DockerHub | ||
uses: docker/build-push-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: CRM-for-Yandex-ambassadors/backend | ||
push: true | ||
tags: margoloko/ya_crm_backend:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,4 +161,3 @@ cython_debug/ | |
.vscode/ | ||
|
||
migrations/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM python:3.11 | ||
|
||
WORKDIR /backend | ||
|
||
RUN pip install gunicorn==20.1.0 | ||
|
||
COPY requirements.txt . | ||
|
||
RUN pip install -r requirements.txt --no-cache-dir | ||
|
||
RUN apt-get update && apt-get install -y nano | ||
|
||
COPY crm_yandex/ . | ||
|
||
CMD ["gunicorn", "crm_yandex.wsgi:application", "--bind", "0.0.0.0:8000", "--reload"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM nginx:1.22.1 | ||
COPY nginx.conf /etc/nginx/templates/default.conf.template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version: '3' | ||
|
||
volumes: | ||
pg_data: | ||
|
||
services: | ||
db: | ||
image: postgres:13.10 | ||
env_file: ../.env | ||
volumes: | ||
- pg_data:/var/lib/postgresql/data | ||
|
||
backend: | ||
image: margoloko/ya_crm_backend:latest | ||
restart: always | ||
build: ../. | ||
env_file: ../.env | ||
depends_on: | ||
- db | ||
|
||
#frontend: | ||
# image: margoloko/ya_crm_frontend:latest | ||
# volumes: | ||
# - ... | ||
# env_file: ../.env | ||
# depends_on: | ||
# - backend | ||
|
||
nginx: | ||
build: . | ||
# Ключ ports устанавливает | ||
# перенаправление всех запросов с порта 8000 хоста | ||
# на порт 80 контейнера. | ||
ports: | ||
- 8000:80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
asgiref==3.7.2 | ||
black==24.2.0 | ||
Django==4.2 | ||
django-oauth-toolkit==2.3.0 | ||
djangorestframework==3.14.0 | ||
django-templated-mail==1.1.1 | ||
djangorestframework-jwt | ||
djangorestframework-simplejwt | ||
djoser==2.1.0 | ||
flake8==6.1.0 | ||
flake8-isort==6.0.0 | ||
psycopg2-binary==2.9.3 | ||
python-dotenv==1.0.1 | ||
pytz==2024.1 | ||
sqlparse==0.4.4 | ||
typing_extensions==4.9.0 | ||
tzdata==2024.1 | ||
urllib3==2.2.1 | ||
virtualenv==20.25.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters