Wonky.Client/prod-build.sh

37 lines
1.2 KiB
Bash
Raw Normal View History

2023-06-20 11:24:22 +02:00
#!/usr/bin/env bash
if [[ -z $1 ]]; then
echo "no version"
exit 1
fi
FILE="$PWD/Wonky.Client/wwwroot/appsettings.json"
2023-07-31 07:00:40 +02:00
FOLDER="prod-${1}"
2023-06-20 11:24:22 +02:00
sed -i "s|\"version\":.*|\"version\": \"$1\",|g" "${FILE}"
2023-07-31 07:00:40 +02:00
sed -i 's|\"rc\":.*|\"rc\": false,|g' "${FILE}"
sed -i 's|\"sandBox\":.*|\"sandBox\": false,|g' "${FILE}"
2023-06-20 11:24:22 +02:00
sed -i 's|\"Default": \"Debug\",|\"Default": \"None\",|g' "${FILE}"
sed -i 's|\"System": \"Debug\",|\"System": \"None\",|g' "${FILE}"
sed -i 's|\"Microsoft\": \"Information\",|\"Microsoft\": \"None\",|g' "${FILE}"
2023-11-03 12:15:17 +01:00
sed -i 's|\"Microsoft\": \"Debug\",|\"Microsoft\": \"None\",|g' "${FILE}"
2023-06-20 11:24:22 +02:00
sed -i 's|\"baseUrl\".*|\"baseUrl\": \"https://zeta.innotec.dk\",|g' "${FILE}"
dotnet clean
2023-06-20 11:24:22 +02:00
dotnet publish -c release
2023-10-11 14:14:19 +02:00
cp --recursive /a/projects/inno/a/Wonky.Client/Wonky.Client/bin/Release/net8.0/publish/ "/a/projects/inno/version-sync/client/${FOLDER}"
2023-06-20 11:24:22 +02:00
# RESET TO DEVELOPMENT
sed -i 's|\"sandBox\".*|\"sandBox\": true,|g' "${FILE}"
2023-06-20 11:24:22 +02:00
sed -i 's|\"Default": \"None\",|\"Default": \"Debug\",|g' "${FILE}"
sed -i 's|\"System": \"None\",|\"System": \"Debug\",|g' "${FILE}"
sed -i 's|\"Microsoft\": \"None\",|\"Microsoft\": \"Information\",|g' "${FILE}"
2023-06-20 11:24:22 +02:00
sed -i 's|\"baseUrl\".*|\"baseUrl\": \"https://dev.innotec.dk\",|g' "${FILE}"
2023-06-20 11:24:22 +02:00
2023-07-31 07:00:40 +02:00
printf "\n==> done building: ${FOLDER} PROD\n"