Skip to content

Commit

Permalink
Feature/modify import commands (#564)
Browse files Browse the repository at this point in the history
* update import import-db.py, export-db.py, docker-compose.prod.yaml

* fix deploy

* on review
  • Loading branch information
OlegGsk authored Oct 6, 2024
1 parent 0fa84aa commit 85c1c19
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 5 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/prod_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- master

env:
DEPLOY_PATH: adaptive_hockey_federation
REGISTRY: ghcr.io
Expand Down Expand Up @@ -87,6 +87,22 @@ jobs:
rm -r infra/stage
rm -r infra/dev
- name: Stopping old containers
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
script: |
STATUS="$(systemctl is-active adaptive_hockey_federation.service)"
if [ "${STATUS}" = "active" ]; then
sudo systemctl stop adaptive_hockey_federation.service
echo "Stopping old containers"
else
echo "No active containers"
fi
- name: Copy infra via ssh
uses: appleboy/scp-action@master
with:
Expand All @@ -98,7 +114,7 @@ jobs:
target: "${{ env.DEPLOY_PATH }}/infra"
rm: true
strip_components: 1

- name: Execute commands on VPS
uses: appleboy/ssh-action@master
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,5 @@ media/
# DS server
a_hockey-main/
adaptive_hockey_federation/service/test_video/

db_dump.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.core.management import call_command
from django.core.management.base import BaseCommand

from adaptive_hockey_federation.core.config.dev_settings import DB_DUMP_FILE
from core.config.dev_settings import DB_DUMP_FILE


class Command(BaseCommand):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.db import connection, transaction
from main.models import Diagnosis

from adaptive_hockey_federation.core.config.dev_settings import (
from core.config.dev_settings import (
FILE_MODEL_MAP,
FIXSTURES_DIR,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.core.management.base import BaseCommand
from django.db import connection

from adaptive_hockey_federation.core.config.dev_settings import DB_DUMP_FILE
from core.config.dev_settings import DB_DUMP_FILE


class Command(BaseCommand):
Expand Down
1 change: 1 addition & 0 deletions infra/prod/docker-compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ services:
volumes:
- static_value:/app/adaptive_hockey_federation/static/
- ../../media:/app/adaptive_hockey_federation/media/
- ../../fixtures:/app/adaptive_hockey_federation/core/fixtures/
env_file:
- ../../.env
depends_on:
Expand Down

0 comments on commit 85c1c19

Please sign in to comment.