jellyfin-server/deployment/portable/docker-build.sh
Matt07211 84fbf64867 Fix broken webserver caused by dotnet publish.
This should be considered a temp fix, as it fixes the symptom and not
the actual root cause of the issue. Why this works? I *feel like* this is
a dependency issue and this change forces it to evalute dependencys in a
different order, avoiding the bug.
2020-01-28 19:37:13 +11:00

37 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Builds the TAR archive inside the Docker container
set -o errexit
set -o xtrace
# Move to source directory
pushd ${SOURCE_DIR}
# Clone down and build Web frontend
web_build_dir="$( mktemp -d )"
web_target="${SOURCE_DIR}/MediaBrowser.WebDashboard/jellyfin-web"
git clone https://github.com/jellyfin/jellyfin-web.git ${web_build_dir}/
pushd ${web_build_dir}
if [[ -n ${web_branch} ]]; then
checkout -b origin/${web_branch}
fi
yarn install
mkdir -p ${web_target}
mv dist/* ${web_target}/
popd
rm -rf ${web_build_dir}
# Get version
version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"
# Build archives
dotnet publish Jellyfin.Server --configuration Release --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none"
tar -cvzf /jellyfin_${version}.portable.tar.gz -C /dist jellyfin_${version}
rm -rf /dist/jellyfin_${version}
# Move the artifacts out
mkdir -p ${ARTIFACT_DIR}/
mv /jellyfin[-_]*.tar.gz ${ARTIFACT_DIR}/
chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}