-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
100 lines (93 loc) · 3.21 KB
/
Copy pathdocker-compose.yml
File metadata and controls
100 lines (93 loc) · 3.21 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
98
99
100
# =============================================================================
# Docker Compose configuration for Route4Me C# SDK Testing Environment
#
# This file provides convenient commands for building, testing, and developing
# the Route4Me C# SDK in a containerized environment.
#
# Usage:
# Build and run tests: docker-compose up test
# Development environment: docker-compose up dev
# Interactive shell: docker-compose run dev /bin/bash
# Build SDK only: docker-compose up build
#
# =============================================================================
services:
# Build service - builds the SDK and all test projects
build:
build:
context: .
dockerfile: Dockerfile
target: build
no_cache: true
container_name: route4me-sdk-build
volumes:
- .:/app
working_dir: /app/route4me-csharp-sdk
command: >
sh -c "
echo 'Building Route4Me SDK...' &&
dotnet restore ./Route4MeSDK.sln &&
dotnet build -v q -c Release ./Route4MeSDKLibrary/Route4MeSDKLibrary.csproj &&
dotnet build -v q -c Release ./Route4MeSDKUnitTest/Route4MeSDKUnitTest.csproj &&
dotnet build -v q -c Release ./Route4MeSdkV5UnitTest/Route4MeSdkV5UnitTest.csproj &&
echo 'Build completed successfully!'
"
# Test service - runs all unit tests
test:
build:
context: .
dockerfile: Dockerfile
target: test
no_cache: true
container_name: route4me-sdk-test
volumes:
- .:/app
working_dir: /app/route4me-csharp-sdk
command: >
sh -c "
echo 'Running Route4Me SDK Tests...' &&
echo '==============================' &&
dotnet test -v n -p:ParallelizeTestCollections=false -c Release --filter Category!=Beacon ./Route4MeSDKUnitTest/Route4MeSDKUnitTest.csproj &&
echo 'All tests completed!'
"
# Development service - provides an interactive development environment
dev:
build:
context: .
dockerfile: Dockerfile
target: development
no_cache: true
container_name: route4me-sdk-dev
volumes:
- .:/app
working_dir: /app/route4me-csharp-sdk
stdin_open: true
tty: true
command: /bin/bash
environment:
- DOTNET_CLI_TELEMETRY_OPTOUT=1
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
# Clean service - removes build artifacts and temporary files
clean:
build:
context: .
dockerfile: Dockerfile
target: base
no_cache: true
container_name: route4me-sdk-clean
volumes:
- .:/app
working_dir: /app/route4me-csharp-sdk
command: >
sh -c "
echo 'Cleaning build artifacts...' &&
find . -name 'bin' -type d -exec rm -rf {} + 2>/dev/null || true &&
find . -name 'obj' -type d -exec rm -rf {} + 2>/dev/null || true &&
find . -name 'TestResults' -type d -exec rm -rf {} + 2>/dev/null || true &&
echo 'Clean completed!'
"
# =============================================================================
# Additional configurations for different scenarios
# =============================================================================
# Override for CI/CD environments
# Usage: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up test