Wonky.Client/edu-build.sh

41 lines
1.4 KiB
Bash
Raw Permalink 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
BUILD="/a/projects/inno/a/Wonky.Client/Wonky.Client/bin/Release/net8.0/publish/"
DIST="/a/projects/inno/version-sync/client"
2023-06-20 11:24:22 +02:00
FILE="$PWD/Wonky.Client/wwwroot/appsettings.json"
2023-07-31 07:00:40 +02:00
FOLDER="edu-${1}"
2023-06-20 11:24:22 +02:00
sed -i "s|\"version\".*|\"version\": \"${1}\",|g" "${FILE}"
sed -i 's|\"rc\".*|\"rc\": true,|g' "${FILE}"
sed -i 's|\"sandBox\".*|\"sandBox\": true,|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://eta.innotec.dk\",|g' "${FILE}"
dotnet clean
2023-06-20 11:24:22 +02:00
dotnet publish -c release
cp --recursive "${BUILD}" "${DIST}/${FOLDER}"
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on "${DIST}/${FOLDER}.7z" "${DIST}/${FOLDER}"
rm -r "/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
printf "\n==> done building: ${FOLDER} EDU SANDBOX\n"