2016-08-08 18:43:27 +03:00
|
|
|
#!/bin/bash
|
2016-10-24 18:01:11 +03:00
|
|
|
function printUsage()
|
|
|
|
{
|
|
|
|
echo "USAGE:"
|
|
|
|
echo "pushMusicStoreService [runtime] [framework]"
|
2019-05-13 18:14:37 +03:00
|
|
|
echo "runtime - target runtime to publish (e.g. win10-x64, ubuntu.16.04-x64)"
|
2018-05-29 16:08:40 +03:00
|
|
|
echo "framework - target framework to publish (e.g. net461, netcoreapp2.1)"
|
2016-10-24 18:01:11 +03:00
|
|
|
exit
|
|
|
|
}
|
|
|
|
#
|
|
|
|
if [ "$1" == "" ]; then
|
|
|
|
printUsage
|
|
|
|
fi
|
|
|
|
if [ "$2" == "" ]; then
|
|
|
|
printUsage
|
|
|
|
fi
|
|
|
|
r=$1
|
2016-08-08 18:43:27 +03:00
|
|
|
cd src/MusicStoreService
|
2017-12-20 16:18:54 +03:00
|
|
|
|
2016-08-08 18:43:27 +03:00
|
|
|
dotnet restore --configfile nuget.config
|
2017-12-20 16:18:54 +03:00
|
|
|
dotnet publish --configuration Release --runtime "$1" --framework "$2"
|
2016-10-24 18:01:11 +03:00
|
|
|
if [ "${r:0:3}" == "win" ]; then
|
2017-12-20 16:18:54 +03:00
|
|
|
cf push -f manifest-windows.yml -p "bin/Release/$2/$1/publish"
|
2016-10-24 18:01:11 +03:00
|
|
|
fi
|
|
|
|
if [ "${r:0:6}" == "ubuntu" ]; then
|
2017-12-20 16:18:54 +03:00
|
|
|
cf push -f manifest.yml -p "bin/Release/$2/$1/publish"
|
2016-10-24 18:01:11 +03:00
|
|
|
fi
|
2016-08-08 18:43:27 +03:00
|
|
|
cd ../..
|