-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-all.sh
More file actions
68 lines (51 loc) · 2 KB
/
build-all.sh
File metadata and controls
68 lines (51 loc) · 2 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
#!/bin/bash
# Complete build script for the entire project
set -e
echo "=== Building .NET Core Stress Test Application with Native C Library ==="
# Step 1: Build the native C library
echo "Step 1: Building native C library..."
cd NativeLibrary
chmod +x build.sh
./build.sh
# Check if library was built successfully
if [ ! -f "output/libNativeWorker.so" ]; then
echo "❌ Native library build failed!"
exit 1
fi
echo "✅ Native library built successfully"
cd ..
# Step 2: Build the .NET application
echo "Step 2: Building .NET application..."
# Copy native library to the output directory where .NET can find it
mkdir -p StressTestApp/bin/Release/net8.0
cp NativeLibrary/output/libNativeWorker.so StressTestApp/bin/Release/net8.0/
# Restore and build projects individually
echo "Restoring NativeComponent..."
dotnet restore NativeComponent/NativeComponent.csproj
echo "Building NativeComponent..."
dotnet build NativeComponent/NativeComponent.csproj --configuration Release
echo "Restoring StressTestApp..."
dotnet restore StressTestApp/StressTestApp.csproj
echo "Building StressTestApp..."
dotnet build StressTestApp/StressTestApp.csproj --configuration Release
if [ $? -ne 0 ]; then
echo "❌ .NET build failed!"
exit 1
fi
echo "✅ .NET application built successfully"
# Step 3: Test the application (optional)
echo "Step 3: Testing integration..."
export LD_LIBRARY_PATH=$(pwd)/StressTestApp/bin/Release/net8.0:$LD_LIBRARY_PATH
# Run a quick test (uncomment if you want to test locally)
# timeout 10s dotnet run --project StressTestApp --configuration Release || echo "Test completed (timeout expected)"
echo "✅ Build completed successfully!"
echo ""
echo "To run the application locally:"
echo " export LD_LIBRARY_PATH=$(pwd)/StressTestApp/bin/Release/net8.0:\$LD_LIBRARY_PATH"
echo " dotnet run --project StressTestApp --configuration Release"
echo ""
echo "To build Docker image:"
echo " docker build -t stress-test-app:latest ."
echo ""
echo "To deploy to Kubernetes:"
echo " ./deploy.sh build-deploy"