You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

69 lines
1.4 KiB

#!/bin/bash
SYSTEM=`uname -s`
BUILD_CONFIG=Debug
PUBLISH_CONFIG=Release
NETCOREVER=net5.0
RUNTIME_WIN=win7-x64
RUNTIME_LINUX=ubuntu.18.04-x64
RUNTIME=$RUNTIME_WIN
if [ $SYSTEM = "Linux" ] ; then
RUNTIME=$RUNTIME_LINUX
fi
RESTORE=false
PUBLISH=false
cd ..
if [ "$1" = "rebuild" ] ; then
rm ./output_bill/* -rf
elif [ "$1" = "restore" ] ; then
RESTORE=true
dotnet restore ./Sog
dotnet restore ./ServerComm
elif [ "$1" = "publish" ] ; then
RUNTIME=$RUNTIME_LINUX
PUBLISH=true
rm ./output_bill/* -rf
rm ./publish_bill/bin/* -rf
rm ./publish_bill/cfg/* -rf
cp ./cfg/* ./publish_bill/cfg/ -rf
fi
build_one_proj_exe()
{
cd ./$1
if [ $RESTORE = "true" ] ; then
dotnet restore ./$1
fi
if [ $PUBLISH = "true" ] ; then
dotnet.exe publish --configuration $PUBLISH_CONFIG --runtime $RUNTIME --output "../publish_bill/bin" --framework $NETCOREVER
else
dotnet build --configuration $BUILD_CONFIG --runtime $RUNTIME --output "../bin_bill" --framework $NETCOREVER
fi
cd ..
}
build_one_proj_exe bill_statistics
if [ $PUBLISH = "true" ] ; then
rm ./publish_bill/bin/netcoreapp2.1/ubuntu.16.04-x64/*
if [ "$2" != "full" ] ; then
rm ./publish_bill/bin/lib* -rf
rm ./publish_bill/bin/Microsoft* -rf
rm ./publish_bill/bin/System.* -rf
fi
rm ./publish_bill.tgz
tar zcvf ./publish_bill.tgz ./publish_bill
scp -P 56000 publish_bill.tgz mmog@47.88.148.163:~
md5sum ./publish_bill.tgz
fi