aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 76da020f6d96dda8d783bdc0d6ae9b42bbdf1a2e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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 "Deployment completed!"

test-all:
	@pytest -q -s .

test:
	@pytest -q -s -m "not slow"