Files
APT-Package/run-build.sh

42 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
VERSION="$1"
DEBIAN_PACKAGE_PATH="$2"
ENVIRONMENT="$3"
if [ "$#" -ne 3 ]; then
echo "Error: You must provide exactly three arguments."
exit 1
fi
echo "$VERSION" "$DEBIAN_PACKAGE_PATH" "$ENVIRONMENT"
echo "Building oqtane.framework"
dotnet restore ./oqtane.framework/Oqtane.slnx
dotnet build ./oqtane.framework/Oqtane.slnx --no-restore
dotnet build -c "$ENVIRONMENT" ./oqtane.framework/Oqtane.slnx --no-restore
dotnet publish -c "$ENVIRONMENT" ./oqtane.framework/Oqtane.Server/Oqtane.Server.csproj -o ./alumnihub/opt/alumnihub --no-restore
dotnet build -c "$ENVIRONMENT" ./interfaces/SZUAbsolventenverein.slnx --no-restore
mkdir -p ./oqtane.framework/Oqtane.Server/Packages
echo ""
echo "Building Modules and Themes"
for module in $(ls . | grep -E 'Module|Theme')
do
echo "######## Building $module"
dotnet restore ./$module/*.slnx
dotnet build -c "$ENVIRONMENT" ./$module/*.slnx --no-restore
dotnet publish -c "$ENVIRONMENT" ./$module/*.slnx --no-restore
done
cp -r ./oqtane.framework/Oqtane.Server/Packages ./alumnihub/opt/alumnihub/Packages
rm ./alumnihub/opt/alumnihub/appsettings.json
echo "Version: ${VERSION}" >> $DEBIAN_PACKAGE_PATH/DEBIAN/control
dpkg-deb --root-owner-group --build $DEBIAN_PACKAGE_PATH