new .workflow
All checks were successful
DMA-CSD-CICD/kristoffer.morsing/pipeline/head This commit looks good

This commit is contained in:
KristofferMorsing
2026-04-07 12:33:41 +02:00
parent 209e5692b1
commit 37c4f22fe2
12 changed files with 7 additions and 916 deletions

View File

@@ -1,26 +1,5 @@
#!/bin/bash
/bin/echo "$0 - Building all projects"
echo "USER: $UID"
/bin/find ./ -type f -name "*.csproj" -exec dotnet build "{}" \;
echo "OK" > jenkins.result
# Find all .csproj files and loop through them
find . -type f -name "*.csproj" | while read -r csproj; do
echo "Building $csproj..."
# Run dotnet build on the csproj file
dotnet build "$csproj"
# If dotnet build fails (non-zero exit code), exit the script with an error code
if [ $? -ne 0 ]; then
echo "Build failed for $csproj. Exiting with error."
echo "ERROR" > jenkins.result
fi
done
RESULT=$(cat jenkins.result)
echo "RESULT=$RESULT"
if [ "$RESULT" == "OK" ]; then
echo "All builds succeeded."
exit 0
else
echo "Errors were recorded"
exit 1
fi