Kavita/monorepo-build.sh
Joseph Milazzo 7bfd2c432d
Feature/docker parity (#714)
* Refactored all the config files for Kavita to be loaded from config/. This will allow docker to just mount one folder and for Update functionality to be trivial.

* Cleaned up documentation around new update method.

* Updated docker files to support config directory

* Removed entrypoint, no longer needed

* Update appsettings to point to config directory for logs

* Updated message for docker users that are upgrading

* Ensure that docker users that have not updated their mount points from upgrade cannot start the server

* Code smells

* More cleanup

* Added entrypoint to fix bind mount issues

* Updated README with new folder structure

* Fixed build system for new setup

* Updated string path if user is docker

* Updated the migration flow for docker to work properly and Fixed LogFile configuration updating.

* Migrating docker images is now working 100%

* Fixed config from bad code

* Code cleanup

* Fixed monorepo-build.sh

Co-authored-by: Chris Plaatjes <kizaing@gmail.com>
2021-11-03 07:07:04 -07:00

91 lines
1.8 KiB
Bash
Executable file

#! /bin/bash
set -e
outputFolder='_output'
ProgressStart()
{
echo "Start '$1'"
}
ProgressEnd()
{
echo "Finish '$1'"
}
Build()
{
local RID="$1"
ProgressStart "Build for $RID"
slnFile=Kavita.sln
dotnet clean $slnFile -c Release
dotnet msbuild -restore $slnFile -p:Configuration=Release -p:Platform="Any CPU" -p:RuntimeIdentifiers=$RID
ProgressEnd "Build for $RID"
}
Package()
{
local framework="$1"
local runtime="$2"
local lOutputFolder=../_output/"$runtime"/Kavita
ProgressStart "Creating $runtime Package for $framework"
# TODO: Use no-restore? Because Build should have already done it for us
echo "Building"
cd API
echo dotnet publish -c Release --no-restore --self-contained --runtime $runtime -o "$lOutputFolder" --framework $framework
dotnet publish -c Release --no-restore --self-contained --runtime $runtime -o "$lOutputFolder" --framework $framework
echo "Renaming API -> Kavita"
mv "$lOutputFolder"/API "$lOutputFolder"/Kavita
echo "Copying webui wwwroot to build"
cp -r wwwroot/* "$lOutputFolder"/wwwroot/
echo "Copying Install information"
cp ../INSTALL.txt "$lOutputFolder"/README.txt
echo "Copying LICENSE"
cp ../LICENSE "$lOutputFolder"/LICENSE.txt
echo "Show API structure"
find
echo "Copying appsettings.json"
cp appsettings.Development.json $lOutputFolder/config/appsettings.json
echo "Creating tar"
cd ../$outputFolder/"$runtime"/
tar -czvf ../kavita-$runtime.tar.gz Kavita
ProgressEnd "Creating $runtime Package for $framework"
}
dir=$PWD
if [ -d _output ]
then
rm -r _output/
fi
#Build for x64
Build "linux-x64"
Package "net5.0" "linux-x64"
cd "$dir"
#Build for arm
Build "linux-arm"
Package "net5.0" "linux-arm"
cd "$dir"
#Build for arm64
Build "linux-arm64"
Package "net5.0" "linux-arm64"
cd "$dir"