forked from kyantech/Palmr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (56 loc) · 1.92 KB
/
Makefile
File metadata and controls
64 lines (56 loc) · 1.92 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
56
57
58
59
60
61
62
63
64
.PHONY: help build start clean logs stop restart update-version
# Default target
help:
@echo "🚀 Palmr - Available Commands:"
@echo ""
@echo " make build - Build Docker image with multi-platform support"
@echo " make update-version - Update version in all package.json files"
@echo " make start - Start the application using docker-compose"
@echo " make stop - Stop all running containers"
@echo " make logs - Show application logs"
@echo " make clean - Clean up containers and images"
@echo " make shell - Access the application container shell"
@echo ""
@echo "📁 Scripts location: ./infra/"
# Build Docker image using the build script
build:
@echo "🏗️ Building Palmr Docker image..."
@echo "📝 This will update version numbers in all package.json files before building"
@echo ""
@chmod +x ./infra/update-versions.sh
@chmod +x ./infra/build-docker.sh
@echo "🔄 Starting build process..."
@./infra/build-docker.sh
# Update version in all package.json files
update-version:
@echo "🔄 Updating version numbers..."
@echo "🏷️ Please enter the new version (e.g., v3.0.0, 3.0-beta):"
@read -p "Version: " VERSION; \
if [ -z "$$VERSION" ]; then \
echo "❌ Error: Version cannot be empty"; \
exit 1; \
fi; \
chmod +x ./infra/update-versions.sh; \
./infra/update-versions.sh "$$VERSION"
# Start the application
start:
@echo "🚀 Starting Palmr application..."
@docker-compose up -d
# Stop the application
stop:
@echo "🛑 Stopping Palmr application..."
@docker-compose down
# Show logs
logs:
@echo "📋 Showing Palmr logs..."
@docker-compose logs -f
# Clean up containers and images
clean:
@echo "🧹 Cleaning up Docker containers and images..."
@docker-compose down -v
@docker system prune -f
@echo "✅ Cleanup completed!"
# Access container shell
shell:
@echo "🐚 Accessing Palmr container shell..."
@docker-compose exec palmr /bin/sh