jellyfin/deployment/linux-x64/docker-build.sh
Joshua Boniface b3fc995977 Add bad web build branch hotfix
I hate this quick and dirty hack but it makes no sense to port to
master. This fixes a bug whereby we'd build with the master Web branch
on releases due to never checking out the right branch. This is already
obsoleted in the master branch since #1925 already replaces this entire
process for Debuntu builds, and others should be fixed with a more
robust solution. That said, for the 10.4.z release chain, this
ultra-quick solution fixes the problem without changing much.
2019-11-24 15:42:43 -05: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
git checkout 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 --configuration Release --self-contained --runtime linux-x64 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true"
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}