blob: 873fd07bb6cf9518784b6fee3eca6646cd24ac16 (
plain) (
tree)
|
|
deploy-to-staging:
# Define variables
SERVER_USER = jo
SERVER_IP = jo.banded-neon.ts.net
PROJECT_DIR = /home/jo/alphabetlearning
.PHONY: deploy
deploy-to-staging:
@echo "1. Pushing changes to remote repository..."
git push
@echo "2. Logging into the server and pulling latest changes..."
ssh $(SERVER_USER)@$(SERVER_IP) "cd $(PROJECT_DIR) && git pull"
@echo "3. Building the Docker image..."
ssh $(SERVER_USER)@$(SERVER_IP) "cd $(PROJECT_DIR) && docker compose build --no-cache"
@echo "4. Running the Docker container..."
ssh $(SERVER_USER)@$(SERVER_IP) "cd $(PROJECT_DIR) && docker compose up -d"
@echo "5. Migrating database..."
ssh $(SERVER_USER)@$(SERVER_IP) "cd $(PROJECT_DIR) && docker compose exec web uv run manage.py migrate"
@echo "6. Collecing static files..."
ssh $(SERVER_USER)@$(SERVER_IP) "cd $(PROJECT_DIR) && docker compose exec web uv run manage.py collectstatic --noinput"
@echo "Deployment completed!"
test-all:
@pytest -q -s .
test:
@pytest -q -s -m "not slow"
|