-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (46 loc) · 1.43 KB
/
Copy pathMakefile
File metadata and controls
55 lines (46 loc) · 1.43 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.PHONY: setup run test clean help db-up db-down db-logs db-shell
help:
@echo "Available commands:"
@echo " setup - Set up the project environment and start database"
@echo " run - Run the application"
@echo " test - Run tests"
@echo " clean - Clean up temporary files and stop containers"
@echo " db-up - Start the PostgreSQL database"
@echo " db-down - Stop the PostgreSQL database"
@echo " db-logs - Show database logs"
@echo " db-shell - Connect to the database shell"
@echo " help - Show this help message"
setup:
@echo "Setting up the project..."
@echo "Starting PostgreSQL database..."
@docker-compose up -d
@echo "Waiting for database to be ready..."
@sleep 5
@echo "Setup complete!"
run:
@echo "Running the application..."
@./bin/start.sh
test:
@echo "Running tests..."
@echo "Starting test database if not running..."
@docker-compose up -d
@echo "Running test script..."
@./bin/test.sh
clean:
@echo "Cleaning up..."
@echo "Stopping and removing containers..."
@docker-compose down -v
@echo "Removing any temporary files..."
@rm -rf *.log *.tmp
db-up:
@echo "Starting PostgreSQL database..."
@docker-compose up -d
db-down:
@echo "Stopping PostgreSQL database..."
@docker-compose down
db-logs:
@echo "Showing database logs..."
@docker-compose logs -f postgres
db-shell:
@echo "Connecting to database shell..."
@docker-compose exec postgres psql -U messaging_user -d messaging_service