-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (77 loc) · 2.53 KB
/
Makefile
File metadata and controls
97 lines (77 loc) · 2.53 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
.PHONY: build test clean publish restore run
# .NET Solution Management for Payment Service
# Build the solution
build:
dotnet build payment.slnx
# Build in Release mode
build-release:
dotnet build payment.slnx -c Release
# Run tests
test:
dotnet test payment.slnx
# Run tests with coverage
test-coverage:
dotnet test payment.slnx --collect:"XPlat Code Coverage"
# Clean build artifacts
clean:
dotnet clean payment.slnx
rm -rf Application/bin Application/obj
rm -rf Domain/bin Domain/obj
rm -rf Infrastructure/bin Infrastructure/obj
rm -rf payment/bin payment/obj
# Restore packages
restore:
dotnet restore payment.slnx
# Run the application
run:
dotnet run --project payment
# Run in development mode
run-dev:
ASPNETCORE_ENVIRONMENT=Development dotnet run --project payment
# Watch mode for development
watch:
dotnet watch --project payment run
# Publish the application
publish:
dotnet publish payment.slnx -c Release -o ./publish
# Database migrations (EF Core)
migration-add:
@read -p "Migration name: " name; \
dotnet ef migrations add $$name --project Infrastructure --startup-project payment
migration-update:
dotnet ef database update --project Infrastructure --startup-project payment
migration-remove:
dotnet ef migrations remove --project Infrastructure --startup-project payment
# Docker commands
docker-build:
docker build -t minisource/payment:latest .
docker-run:
docker run -p 4005:4005 --env-file .env minisource/payment:latest
docker-up:
docker-compose -f docker-compose.dev.yml up --build
docker-down:
docker-compose -f docker-compose.dev.yml down
# Formatting and linting
format:
dotnet format payment.slnx
# Help
help:
@echo "Available targets:"
@echo " build - Build the solution"
@echo " build-release - Build in Release mode"
@echo " test - Run tests"
@echo " test-coverage - Run tests with coverage"
@echo " clean - Clean build artifacts"
@echo " restore - Restore NuGet packages"
@echo " run - Run the application"
@echo " run-dev - Run in development mode"
@echo " watch - Run with file watching"
@echo " publish - Publish for deployment"
@echo " migration-add - Add new EF Core migration"
@echo " migration-update - Update database"
@echo " migration-remove - Remove last migration"
@echo " docker-build - Build Docker image"
@echo " docker-run - Run Docker container"
@echo " docker-up - Start with docker-compose"
@echo " docker-down - Stop docker-compose"
@echo " format - Format code"