Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/modify import commands #564

Merged
merged 3 commits into from
Oct 6, 2024
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
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
Loading