-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (63 loc) · 1.68 KB
/
Makefile
File metadata and controls
74 lines (63 loc) · 1.68 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
65
66
67
68
69
70
71
72
73
74
.PHONY: help dev build start stop restart logs test test-ansible clean push
# Help target
help:
@echo "Available commands:"
@echo " make dev Start development environment"
@echo " make build Build all services"
@echo " make start Start all services"
@echo " make stop Stop all services"
@echo " make restart Restart all services"
@echo " make logs Show logs"
@echo " make test Run tests"
@echo " make clean Clean up Docker resources"
@echo " make push Build, test, and push changes"
# Development
dev:
@echo "🚀 Starting development environment..."
@cp .env.dev .env
@docker-compose up -d
# Build
build:
@echo "🔨 Building services..."
@docker-compose build
# Start/Stop/Restart
start:
@echo "🚀 Starting services..."
@docker-compose up -d
stop:
@echo "🛑 Stopping services..."
@docker-compose down
restart: stop start
# Logs
logs:
@docker-compose logs -f
# Testing
test: test-ansible
# Run Ansible tests
test-ansible:
@echo "🧪 Running Ansible tests..."
@if [ -f "tests/ansible/playbook.yml" ]; then \
cd tests/ansible && ansible-playbook playbook.yml; \
else \
echo "⚠️ Ansible tests not found. Skipping..."; \
fi
# Cleanup
clean:
@echo "🧹 Cleaning up..."
@docker-compose down -v
# Build and push git changes
push:
@echo "🚀 Starting build and push process..."
@if [ ! -f "scripts/build.sh" ]; then \
echo "❌ Error: build.sh not found in scripts/ directory"; \
exit 1; \
fi
@./scripts/build.sh
@echo "📦 Committing changes..."
@git add .
@if ! git diff-index --quiet HEAD --; then \
git commit -m "[auto] Update at $$(date '+%Y-%m-%d %H:%M:%S')"; \
git push; \
else \
echo "ℹ️ No changes to commit"; \
fi