aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 77d18b4cc5065fe23e78f90e773866612ab80eda (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
27
28
29
30
deploy-to-staging:
# Define variables
SERVER_USER = jo
SERVER_IP = jo.banded-neon.ts.net
PROJECT_DIR = /home/jo/alphabetlearning

.PHONY: deploy

run-development-server:
	@echo "Running the development server..."
	uv run manage.py runserver

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:
	@uv run pytest -q -s .

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