Merge pull request #1793 from joshuaboniface/fix-build
Clean up and update builds to use new jellyfin-webpull/1801/head
commit
e4d5e5bf91
@ -1,110 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
|
|
||||||
RED='\033[0;31m'
|
|
||||||
GREEN='\033[0;32m'
|
|
||||||
CYAN='\033[0;36m'
|
|
||||||
NC='\033[0m' # No Color
|
|
||||||
|
|
||||||
DEFAULT_BUILD_CONTEXT="../.."
|
|
||||||
DEFAULT_ROOT="."
|
|
||||||
DEFAULT_DOTNETRUNTIME="framework"
|
|
||||||
DEFAULT_CONFIG="Release"
|
|
||||||
DEFAULT_OUTPUT_DIR="dist/jellyfin-git"
|
|
||||||
DEFAULT_PKG_DIR="pkg-dist"
|
|
||||||
DEFAULT_DOCKERFILE="Dockerfile"
|
|
||||||
DEFAULT_ARCHIVE_CMD="tar -xvzf"
|
|
||||||
|
|
||||||
# Parse the version from the build.yaml version
|
|
||||||
get_version()
|
|
||||||
(
|
|
||||||
local ROOT=${1-$DEFAULT_ROOT}
|
|
||||||
grep "version:" ${ROOT}/build.yaml \
|
|
||||||
| sed -E 's/version: "([0-9\.]+.*)"/\1/'
|
|
||||||
)
|
|
||||||
|
|
||||||
# Run a build
|
|
||||||
build_jellyfin()
|
|
||||||
(
|
|
||||||
ROOT=${1-$DEFAULT_ROOT}
|
|
||||||
CONFIG=${2-$DEFAULT_CONFIG}
|
|
||||||
DOTNETRUNTIME=${3-$DEFAULT_DOTNETRUNTIME}
|
|
||||||
OUTPUT_DIR=${4-$DEFAULT_OUTPUT_DIR}
|
|
||||||
|
|
||||||
echo -e "${CYAN}Building jellyfin in '${ROOT}' for ${DOTNETRUNTIME} with configuration ${CONFIG} and output directory '${OUTPUT_DIR}'.${NC}"
|
|
||||||
if [[ $DOTNETRUNTIME == 'framework' ]]; then
|
|
||||||
dotnet publish "${ROOT}" --configuration "${CONFIG}" --output="${OUTPUT_DIR}" "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none"
|
|
||||||
else
|
|
||||||
dotnet publish "${ROOT}" --configuration "${CONFIG}" --output="${OUTPUT_DIR}" --self-contained --runtime ${DOTNETRUNTIME} "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none"
|
|
||||||
fi
|
|
||||||
EXIT_CODE=$?
|
|
||||||
if [ $EXIT_CODE -eq 0 ]; then
|
|
||||||
echo -e "${GREEN}[DONE] Build jellyfin in '${ROOT}' for ${DOTNETRUNTIME} with configuration ${CONFIG} and output directory '${OUTPUT_DIR}' complete.${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${RED}[FAIL] Build jellyfin in '${ROOT}' for ${DOTNETRUNTIME} with configuration ${CONFIG} and output directory '${OUTPUT_DIR}' FAILED.${NC}"
|
|
||||||
fi
|
|
||||||
)
|
|
||||||
|
|
||||||
# Run a docker
|
|
||||||
build_jellyfin_docker()
|
|
||||||
(
|
|
||||||
BUILD_CONTEXT=${1-$DEFAULT_BUILD_CONTEXT}
|
|
||||||
DOCKERFILE=${2-$DEFAULT_DOCKERFILE}
|
|
||||||
IMAGE_TAG=${3-"jellyfin:$(git rev-parse --abbrev-ref HEAD)"}
|
|
||||||
|
|
||||||
echo -e "${CYAN}Building jellyfin docker image in '${BUILD_CONTEXT}' with Dockerfile '${DOCKERFILE}' and tag '${IMAGE_TAG}'.${NC}"
|
|
||||||
docker build -t ${IMAGE_TAG} -f ${DOCKERFILE} ${BUILD_CONTEXT}
|
|
||||||
EXIT_CODE=$?
|
|
||||||
if [ $EXIT_CODE -eq 0 ]; then
|
|
||||||
echo -e "${GREEN}[DONE] Building jellyfin docker image in '${BUILD_CONTEXT}' with Dockerfile '${DOCKERFILE}' and tag '${IMAGE_TAG}' complete.${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${RED}[FAIL] Building jellyfin docker image in '${BUILD_CONTEXT}' with Dockerfile '${DOCKERFILE}' and tag '${IMAGE_TAG}' FAILED.${NC}"
|
|
||||||
fi
|
|
||||||
)
|
|
||||||
|
|
||||||
# Clean a build
|
|
||||||
clean_jellyfin()
|
|
||||||
(
|
|
||||||
local ROOT=${1-$DEFAULT_ROOT}
|
|
||||||
local CONFIG=${2-$DEFAULT_CONFIG}
|
|
||||||
local OUTPUT_DIR=${3-$DEFAULT_OUTPUT_DIR}
|
|
||||||
local PKG_DIR=${4-$DEFAULT_PKG_DIR}
|
|
||||||
echo -e "${CYAN}Cleaning jellyfin in '${ROOT}'' with configuration ${CONFIG} and output directory '${OUTPUT_DIR}'.${NC}"
|
|
||||||
echo -e "${CYAN}Deleting '${OUTPUT_DIR}'${NC}"
|
|
||||||
rm -rf "$OUTPUT_DIR"
|
|
||||||
echo -e "${CYAN}Deleting '${PKG_DIR}'${NC}"
|
|
||||||
rm -rf "$PKG_DIR"
|
|
||||||
dotnet clean "${ROOT}" -maxcpucount:1 --configuration ${CONFIG}
|
|
||||||
local EXIT_CODE=$?
|
|
||||||
if [ $EXIT_CODE -eq 0 ]; then
|
|
||||||
echo -e "${GREEN}[DONE] Clean jellyfin in '${ROOT}' with configuration ${CONFIG} and output directory '${OUTPUT_DIR}' complete.${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${RED}[FAIL] Clean jellyfin in '${ROOT}' with configuration ${CONFIG} and output directory '${OUTPUT_DIR}' failed.${NC}"
|
|
||||||
fi
|
|
||||||
)
|
|
||||||
|
|
||||||
# Packages the output folder into an archive.
|
|
||||||
package_portable()
|
|
||||||
(
|
|
||||||
local ROOT=${1-$DEFAULT_ROOT}
|
|
||||||
local OUTPUT_DIR=${2-$DEFAULT_OUTPUT_DIR}
|
|
||||||
local PKG_DIR=${3-$DEFAULT_PKG_DIR}
|
|
||||||
local ARCHIVE_CMD=${4-$DEFAULT_ARCHIVE_CMD}
|
|
||||||
# Package portable build result
|
|
||||||
if [ -d ${OUTPUT_DIR} ]; then
|
|
||||||
echo -e "${CYAN}Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}'.${NC}"
|
|
||||||
mkdir -p ${PKG_DIR}
|
|
||||||
tar -zcvf "${PKG_DIR}/`basename "${OUTPUT_DIR}"`.portable.tar.gz" -C "`dirname "${OUTPUT_DIR}"`" "`basename "${OUTPUT_DIR}"`"
|
|
||||||
local EXIT_CODE=$?
|
|
||||||
if [ $EXIT_CODE -eq 0 ]; then
|
|
||||||
echo -e "${GREEN}[DONE] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' complete.${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${RED}[FAIL] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' FAILED.${NC}"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo -e "${RED}[FAIL] Build artifacts do not exist for ${OUTPUT_DIR}. Run build.sh first.${NC}"
|
|
||||||
fi
|
|
||||||
)
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
source ../common.build.sh
|
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
|
||||||
|
|
||||||
build_jellyfin_docker ../.. ../../Dockerfile jellyfin:amd64-${VERSION}
|
|
||||||
|
|
||||||
build_jellyfin_docker ../.. ../../Dockerfile.arm jellyfin:arm-${VERSION}
|
|
||||||
|
|
||||||
#build_jellyfin_docker ../.. ../../Dockerfile.arm64v8 jellyfin:arm64v8-${VERSION}
|
|
||||||
#build_jellyfin_docker ../.. ../../Dockerfile.arm32v7 jellyfin:arm32v7-${VERSION}
|
|
@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
source ../common.build.sh
|
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
|
||||||
|
|
||||||
docker manifest create jellyfin:${VERSION} jellyfin:amd64-${VERSION} jellyfin:arm32v7-${VERSION} jellyfin:arm64v8-${VERSION}
|
|
||||||
docker manifest annotate jellyfin:amd64-${VERSION} --os linux --arch amd64
|
|
||||||
#docker manifest annotate jellyfin:arm32v7-${VERSION} --os linux --arch arm --variant armv7
|
|
||||||
#docker manifest annotate jellyfin:arm64v8-${VERSION} --os linux --arch arm64 --variant armv8
|
|
||||||
|
|
||||||
#TODO publish.sh - docker manifest push jellyfin:${VERSION}
|
|
@ -1,55 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# shellcheck disable=SC1091
|
|
||||||
source ../common.build.sh
|
|
||||||
|
|
||||||
WORKDIR="$( pwd )"
|
|
||||||
VERSION="$( sed -ne '/^Version:/s/.* *//p' "${WORKDIR}"/pkg-src/jellyfin.spec )"
|
|
||||||
|
|
||||||
package_temporary_dir="${WORKDIR}/pkg-dist-tmp"
|
|
||||||
pkg_src_dir="${WORKDIR}/pkg-src"
|
|
||||||
|
|
||||||
GNU_TAR=1
|
|
||||||
echo "Bundling all sources for RPM build."
|
|
||||||
tar \
|
|
||||||
--transform "s,^\.,jellyfin-${VERSION}," \
|
|
||||||
--exclude='.git*' \
|
|
||||||
--exclude='**/.git' \
|
|
||||||
--exclude='**/.hg' \
|
|
||||||
--exclude='**/.vs' \
|
|
||||||
--exclude='**/.vscode' \
|
|
||||||
--exclude='deployment' \
|
|
||||||
--exclude='**/bin' \
|
|
||||||
--exclude='**/obj' \
|
|
||||||
--exclude='**/.nuget' \
|
|
||||||
--exclude='*.deb' \
|
|
||||||
--exclude='*.rpm' \
|
|
||||||
-czf "$pkg_src_dir/jellyfin-${VERSION}.tar.gz" \
|
|
||||||
-C "../.." ./ || GNU_TAR=0
|
|
||||||
|
|
||||||
if [ $GNU_TAR -eq 0 ]; then
|
|
||||||
echo "The installed tar binary did not support --transform. Using workaround."
|
|
||||||
mkdir -p "${package_temporary_dir}/jellyfin"{,-"${VERSION}"}
|
|
||||||
# Not GNU tar
|
|
||||||
tar \
|
|
||||||
--exclude='.git*' \
|
|
||||||
--exclude='**/.git' \
|
|
||||||
--exclude='**/.hg' \
|
|
||||||
--exclude='**/.vs' \
|
|
||||||
--exclude='**/.vscode' \
|
|
||||||
--exclude='deployment' \
|
|
||||||
--exclude='**/bin' \
|
|
||||||
--exclude='**/obj' \
|
|
||||||
--exclude='**/.nuget' \
|
|
||||||
--exclude='*.deb' \
|
|
||||||
--exclude='*.rpm' \
|
|
||||||
-zcf \
|
|
||||||
"${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz" \
|
|
||||||
-C "../.." ./
|
|
||||||
echo "Extracting filtered package."
|
|
||||||
tar -xzf "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz" -C "${package_temporary_dir}/jellyfin-${VERSION}"
|
|
||||||
echo "Removing filtered package."
|
|
||||||
rm -f "${package_temporary_dir}/jellyfin/jellyfin-${VERSION}.tar.gz"
|
|
||||||
echo "Repackaging package into final tarball."
|
|
||||||
tar -czf "${pkg_src_dir}/jellyfin-${VERSION}.tar.gz" -C "${package_temporary_dir}" "jellyfin-${VERSION}"
|
|
||||||
fi
|
|
@ -0,0 +1,37 @@
|
|||||||
|
FROM debian:10
|
||||||
|
# Docker build arguments
|
||||||
|
ARG SOURCE_DIR=/jellyfin
|
||||||
|
ARG PLATFORM_DIR=/jellyfin/deployment/linux-x64
|
||||||
|
ARG ARTIFACT_DIR=/dist
|
||||||
|
ARG SDK_VERSION=2.2
|
||||||
|
# Docker run environment
|
||||||
|
ENV SOURCE_DIR=/jellyfin
|
||||||
|
ENV ARTIFACT_DIR=/dist
|
||||||
|
ENV DEB_BUILD_OPTIONS=noddebs
|
||||||
|
ENV ARCH=amd64
|
||||||
|
|
||||||
|
# Prepare Debian build environment
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
|
||||||
|
|
||||||
|
# Install dotnet repository
|
||||||
|
# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current
|
||||||
|
RUN wget https://download.visualstudio.microsoft.com/download/pr/228832ea-805f-45ab-8c88-fa36165701b9/16ce29a06031eeb09058dee94d6f5330/dotnet-sdk-2.2.401-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
|
||||||
|
&& mkdir -p dotnet-sdk \
|
||||||
|
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
|
||||||
|
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
|
||||||
|
|
||||||
|
# Install yarn package manager
|
||||||
|
RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
|
||||||
|
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
|
||||||
|
&& apt update \
|
||||||
|
&& apt install -y yarn
|
||||||
|
|
||||||
|
# Link to docker-build script
|
||||||
|
RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh
|
||||||
|
|
||||||
|
VOLUME ${ARTIFACT_DIR}/
|
||||||
|
|
||||||
|
COPY . ${SOURCE_DIR}/
|
||||||
|
|
||||||
|
ENTRYPOINT ["/docker-build.sh"]
|
@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
source ../common.build.sh
|
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
|
||||||
|
|
||||||
build_jellyfin ../../Jellyfin.Server Release linux-x64 `pwd`/dist/jellyfin_${VERSION}
|
|
@ -1,7 +1,27 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
source ../common.build.sh
|
keep_artifacts="${1}"
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
WORKDIR="$( pwd )"
|
||||||
|
|
||||||
clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION}
|
package_temporary_dir="${WORKDIR}/pkg-dist-tmp"
|
||||||
|
output_dir="${WORKDIR}/pkg-dist"
|
||||||
|
current_user="$( whoami )"
|
||||||
|
image_name="jellyfin-linux-build"
|
||||||
|
|
||||||
|
rm -rf "${package_temporary_dir}" &>/dev/null \
|
||||||
|
|| sudo rm -rf "${package_temporary_dir}" &>/dev/null
|
||||||
|
|
||||||
|
rm -rf "${output_dir}" &>/dev/null \
|
||||||
|
|| sudo rm -rf "${output_dir}" &>/dev/null
|
||||||
|
|
||||||
|
if [[ ${keep_artifacts} == 'n' ]]; then
|
||||||
|
docker_sudo=""
|
||||||
|
if [[ ! -z $(id -Gn | grep -q 'docker') ]] \
|
||||||
|
&& [[ ! ${EUID:-1000} -eq 0 ]] \
|
||||||
|
&& [[ ! ${USER} == "root" ]] \
|
||||||
|
&& [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then
|
||||||
|
docker_sudo=sudo
|
||||||
|
fi
|
||||||
|
${docker_sudo} docker image rm ${image_name} --force
|
||||||
|
fi
|
||||||
|
@ -1 +1 @@
|
|||||||
dotnet
|
docker
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
#!/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 --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}
|
@ -1,7 +1,34 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
source ../common.build.sh
|
args="${@}"
|
||||||
|
declare -a docker_envvars
|
||||||
|
for arg in ${args}; do
|
||||||
|
docker_envvars+=("-e ${arg}")
|
||||||
|
done
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
WORKDIR="$( pwd )"
|
||||||
|
|
||||||
package_portable ../.. `pwd`/dist/jellyfin_${VERSION}
|
package_temporary_dir="${WORKDIR}/pkg-dist-tmp"
|
||||||
|
output_dir="${WORKDIR}/pkg-dist"
|
||||||
|
current_user="$( whoami )"
|
||||||
|
image_name="jellyfin-linux-build"
|
||||||
|
|
||||||
|
# Determine if sudo should be used for Docker
|
||||||
|
if [[ ! -z $(id -Gn | grep -q 'docker') ]] \
|
||||||
|
&& [[ ! ${EUID:-1000} -eq 0 ]] \
|
||||||
|
&& [[ ! ${USER} == "root" ]] \
|
||||||
|
&& [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then
|
||||||
|
docker_sudo="sudo"
|
||||||
|
else
|
||||||
|
docker_sudo=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prepare temporary package dir
|
||||||
|
mkdir -p "${package_temporary_dir}"
|
||||||
|
# Set up the build environment Docker image
|
||||||
|
${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile
|
||||||
|
# Build the DEBs and copy out to ${package_temporary_dir}
|
||||||
|
${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars}
|
||||||
|
# Move the DEBs to the output directory
|
||||||
|
mkdir -p "${output_dir}"
|
||||||
|
mv "${package_temporary_dir}"/* "${output_dir}"
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
FROM debian:10
|
||||||
|
# Docker build arguments
|
||||||
|
ARG SOURCE_DIR=/jellyfin
|
||||||
|
ARG PLATFORM_DIR=/jellyfin/deployment/macos
|
||||||
|
ARG ARTIFACT_DIR=/dist
|
||||||
|
ARG SDK_VERSION=2.2
|
||||||
|
# Docker run environment
|
||||||
|
ENV SOURCE_DIR=/jellyfin
|
||||||
|
ENV ARTIFACT_DIR=/dist
|
||||||
|
ENV DEB_BUILD_OPTIONS=noddebs
|
||||||
|
ENV ARCH=amd64
|
||||||
|
|
||||||
|
# Prepare Debian build environment
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
|
||||||
|
|
||||||
|
# Install dotnet repository
|
||||||
|
# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current
|
||||||
|
RUN wget https://download.visualstudio.microsoft.com/download/pr/228832ea-805f-45ab-8c88-fa36165701b9/16ce29a06031eeb09058dee94d6f5330/dotnet-sdk-2.2.401-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
|
||||||
|
&& mkdir -p dotnet-sdk \
|
||||||
|
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
|
||||||
|
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
|
||||||
|
|
||||||
|
# Install yarn package manager
|
||||||
|
RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
|
||||||
|
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
|
||||||
|
&& apt update \
|
||||||
|
&& apt install -y yarn
|
||||||
|
|
||||||
|
# Link to docker-build script
|
||||||
|
RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh
|
||||||
|
|
||||||
|
VOLUME ${ARTIFACT_DIR}/
|
||||||
|
|
||||||
|
COPY . ${SOURCE_DIR}/
|
||||||
|
|
||||||
|
ENTRYPOINT ["/docker-build.sh"]
|
@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
source ../common.build.sh
|
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
|
||||||
|
|
||||||
build_jellyfin ../../Jellyfin.Server Release osx-x64 `pwd`/dist/jellyfin_${VERSION}
|
|
@ -1,7 +1,27 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
source ../common.build.sh
|
keep_artifacts="${1}"
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
WORKDIR="$( pwd )"
|
||||||
|
|
||||||
clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION}
|
package_temporary_dir="${WORKDIR}/pkg-dist-tmp"
|
||||||
|
output_dir="${WORKDIR}/pkg-dist"
|
||||||
|
current_user="$( whoami )"
|
||||||
|
image_name="jellyfin-linux-build"
|
||||||
|
|
||||||
|
rm -rf "${package_temporary_dir}" &>/dev/null \
|
||||||
|
|| sudo rm -rf "${package_temporary_dir}" &>/dev/null
|
||||||
|
|
||||||
|
rm -rf "${output_dir}" &>/dev/null \
|
||||||
|
|| sudo rm -rf "${output_dir}" &>/dev/null
|
||||||
|
|
||||||
|
if [[ ${keep_artifacts} == 'n' ]]; then
|
||||||
|
docker_sudo=""
|
||||||
|
if [[ ! -z $(id -Gn | grep -q 'docker') ]] \
|
||||||
|
&& [[ ! ${EUID:-1000} -eq 0 ]] \
|
||||||
|
&& [[ ! ${USER} == "root" ]] \
|
||||||
|
&& [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then
|
||||||
|
docker_sudo=sudo
|
||||||
|
fi
|
||||||
|
${docker_sudo} docker image rm ${image_name} --force
|
||||||
|
fi
|
||||||
|
@ -1 +1 @@
|
|||||||
dotnet
|
docker
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
#!/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 --configuration Release --self-contained --runtime osx-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}
|
@ -1,7 +1,34 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
source ../common.build.sh
|
args="${@}"
|
||||||
|
declare -a docker_envvars
|
||||||
|
for arg in ${args}; do
|
||||||
|
docker_envvars+=("-e ${arg}")
|
||||||
|
done
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
WORKDIR="$( pwd )"
|
||||||
|
|
||||||
package_portable ../.. `pwd`/dist/jellyfin_${VERSION}
|
package_temporary_dir="${WORKDIR}/pkg-dist-tmp"
|
||||||
|
output_dir="${WORKDIR}/pkg-dist"
|
||||||
|
current_user="$( whoami )"
|
||||||
|
image_name="jellyfin-macos-build"
|
||||||
|
|
||||||
|
# Determine if sudo should be used for Docker
|
||||||
|
if [[ ! -z $(id -Gn | grep -q 'docker') ]] \
|
||||||
|
&& [[ ! ${EUID:-1000} -eq 0 ]] \
|
||||||
|
&& [[ ! ${USER} == "root" ]] \
|
||||||
|
&& [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then
|
||||||
|
docker_sudo="sudo"
|
||||||
|
else
|
||||||
|
docker_sudo=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prepare temporary package dir
|
||||||
|
mkdir -p "${package_temporary_dir}"
|
||||||
|
# Set up the build environment Docker image
|
||||||
|
${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile
|
||||||
|
# Build the DEBs and copy out to ${package_temporary_dir}
|
||||||
|
${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars}
|
||||||
|
# Move the DEBs to the output directory
|
||||||
|
mkdir -p "${output_dir}"
|
||||||
|
mv "${package_temporary_dir}"/* "${output_dir}"
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
FROM debian:10
|
||||||
|
# Docker build arguments
|
||||||
|
ARG SOURCE_DIR=/jellyfin
|
||||||
|
ARG PLATFORM_DIR=/jellyfin/deployment/portable
|
||||||
|
ARG ARTIFACT_DIR=/dist
|
||||||
|
ARG SDK_VERSION=2.2
|
||||||
|
# Docker run environment
|
||||||
|
ENV SOURCE_DIR=/jellyfin
|
||||||
|
ENV ARTIFACT_DIR=/dist
|
||||||
|
ENV DEB_BUILD_OPTIONS=noddebs
|
||||||
|
ENV ARCH=amd64
|
||||||
|
|
||||||
|
# Prepare Debian build environment
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0
|
||||||
|
|
||||||
|
# Install dotnet repository
|
||||||
|
# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current
|
||||||
|
RUN wget https://download.visualstudio.microsoft.com/download/pr/228832ea-805f-45ab-8c88-fa36165701b9/16ce29a06031eeb09058dee94d6f5330/dotnet-sdk-2.2.401-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
|
||||||
|
&& mkdir -p dotnet-sdk \
|
||||||
|
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
|
||||||
|
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
|
||||||
|
|
||||||
|
# Install yarn package manager
|
||||||
|
RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
|
||||||
|
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
|
||||||
|
&& apt update \
|
||||||
|
&& apt install -y yarn
|
||||||
|
|
||||||
|
# Link to docker-build script
|
||||||
|
RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh
|
||||||
|
|
||||||
|
VOLUME ${ARTIFACT_DIR}/
|
||||||
|
|
||||||
|
COPY . ${SOURCE_DIR}/
|
||||||
|
|
||||||
|
ENTRYPOINT ["/docker-build.sh"]
|
@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
source ../common.build.sh
|
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
|
||||||
|
|
||||||
#Magic word framework will create a non self contained build
|
|
||||||
build_jellyfin ../../Jellyfin.Server Release framework `pwd`/dist/jellyfin_${VERSION}
|
|
@ -1,7 +1,27 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
source ../common.build.sh
|
keep_artifacts="${1}"
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
WORKDIR="$( pwd )"
|
||||||
|
|
||||||
clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION}
|
package_temporary_dir="${WORKDIR}/pkg-dist-tmp"
|
||||||
|
output_dir="${WORKDIR}/pkg-dist"
|
||||||
|
current_user="$( whoami )"
|
||||||
|
image_name="jellyfin-linux-build"
|
||||||
|
|
||||||
|
rm -rf "${package_temporary_dir}" &>/dev/null \
|
||||||
|
|| sudo rm -rf "${package_temporary_dir}" &>/dev/null
|
||||||
|
|
||||||
|
rm -rf "${output_dir}" &>/dev/null \
|
||||||
|
|| sudo rm -rf "${output_dir}" &>/dev/null
|
||||||
|
|
||||||
|
if [[ ${keep_artifacts} == 'n' ]]; then
|
||||||
|
docker_sudo=""
|
||||||
|
if [[ ! -z $(id -Gn | grep -q 'docker') ]] \
|
||||||
|
&& [[ ! ${EUID:-1000} -eq 0 ]] \
|
||||||
|
&& [[ ! ${USER} == "root" ]] \
|
||||||
|
&& [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then
|
||||||
|
docker_sudo=sudo
|
||||||
|
fi
|
||||||
|
${docker_sudo} docker image rm ${image_name} --force
|
||||||
|
fi
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
#!/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 --configuration Release --self-contained --runtime framework --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}
|
@ -1,7 +1,34 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
source ../common.build.sh
|
args="${@}"
|
||||||
|
declare -a docker_envvars
|
||||||
|
for arg in ${args}; do
|
||||||
|
docker_envvars+=("-e ${arg}")
|
||||||
|
done
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
WORKDIR="$( pwd )"
|
||||||
|
|
||||||
package_portable ../.. `pwd`/dist/jellyfin_${VERSION}
|
package_temporary_dir="${WORKDIR}/pkg-dist-tmp"
|
||||||
|
output_dir="${WORKDIR}/pkg-dist"
|
||||||
|
current_user="$( whoami )"
|
||||||
|
image_name="jellyfin-portable-build"
|
||||||
|
|
||||||
|
# Determine if sudo should be used for Docker
|
||||||
|
if [[ ! -z $(id -Gn | grep -q 'docker') ]] \
|
||||||
|
&& [[ ! ${EUID:-1000} -eq 0 ]] \
|
||||||
|
&& [[ ! ${USER} == "root" ]] \
|
||||||
|
&& [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then
|
||||||
|
docker_sudo="sudo"
|
||||||
|
else
|
||||||
|
docker_sudo=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prepare temporary package dir
|
||||||
|
mkdir -p "${package_temporary_dir}"
|
||||||
|
# Set up the build environment Docker image
|
||||||
|
${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile
|
||||||
|
# Build the DEBs and copy out to ${package_temporary_dir}
|
||||||
|
${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars}
|
||||||
|
# Move the DEBs to the output directory
|
||||||
|
mkdir -p "${output_dir}"
|
||||||
|
mv "${package_temporary_dir}"/* "${output_dir}"
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
FROM debian:10
|
||||||
|
# Docker build arguments
|
||||||
|
ARG SOURCE_DIR=/jellyfin
|
||||||
|
ARG PLATFORM_DIR=/jellyfin/deployment/win-x64
|
||||||
|
ARG ARTIFACT_DIR=/dist
|
||||||
|
ARG SDK_VERSION=2.2
|
||||||
|
# Docker run environment
|
||||||
|
ENV SOURCE_DIR=/jellyfin
|
||||||
|
ENV ARTIFACT_DIR=/dist
|
||||||
|
ENV DEB_BUILD_OPTIONS=noddebs
|
||||||
|
ENV ARCH=amd64
|
||||||
|
|
||||||
|
# Prepare Debian build environment
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 zip
|
||||||
|
|
||||||
|
# Install dotnet repository
|
||||||
|
# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current
|
||||||
|
RUN wget https://download.visualstudio.microsoft.com/download/pr/228832ea-805f-45ab-8c88-fa36165701b9/16ce29a06031eeb09058dee94d6f5330/dotnet-sdk-2.2.401-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
|
||||||
|
&& mkdir -p dotnet-sdk \
|
||||||
|
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
|
||||||
|
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
|
||||||
|
|
||||||
|
# Install yarn package manager
|
||||||
|
RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
|
||||||
|
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
|
||||||
|
&& apt update \
|
||||||
|
&& apt install -y yarn
|
||||||
|
|
||||||
|
# Link to docker-build script
|
||||||
|
RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh
|
||||||
|
|
||||||
|
VOLUME ${ARTIFACT_DIR}/
|
||||||
|
|
||||||
|
COPY . ${SOURCE_DIR}/
|
||||||
|
|
||||||
|
ENTRYPOINT ["/docker-build.sh"]
|
@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
source ../common.build.sh
|
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
|
||||||
|
|
||||||
build_jellyfin ../../Jellyfin.Server Release win-x64 `pwd`/dist/jellyfin_${VERSION}
|
|
@ -1,7 +1,27 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
source ../common.build.sh
|
keep_artifacts="${1}"
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
WORKDIR="$( pwd )"
|
||||||
|
|
||||||
clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION}
|
package_temporary_dir="${WORKDIR}/pkg-dist-tmp"
|
||||||
|
output_dir="${WORKDIR}/pkg-dist"
|
||||||
|
current_user="$( whoami )"
|
||||||
|
image_name="jellyfin-windows-x64-build"
|
||||||
|
|
||||||
|
rm -rf "${package_temporary_dir}" &>/dev/null \
|
||||||
|
|| sudo rm -rf "${package_temporary_dir}" &>/dev/null
|
||||||
|
|
||||||
|
rm -rf "${output_dir}" &>/dev/null \
|
||||||
|
|| sudo rm -rf "${output_dir}" &>/dev/null
|
||||||
|
|
||||||
|
if [[ ${keep_artifacts} == 'n' ]]; then
|
||||||
|
docker_sudo=""
|
||||||
|
if [[ ! -z $(id -Gn | grep -q 'docker') ]] \
|
||||||
|
&& [[ ! ${EUID:-1000} -eq 0 ]] \
|
||||||
|
&& [[ ! ${USER} == "root" ]] \
|
||||||
|
&& [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then
|
||||||
|
docker_sudo=sudo
|
||||||
|
fi
|
||||||
|
${docker_sudo} docker image rm ${image_name} --force
|
||||||
|
fi
|
||||||
|
@ -1 +1 @@
|
|||||||
dotnet
|
docker
|
||||||
|
@ -0,0 +1,61 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Builds the ZIP archive inside the Docker container
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
set -o xtrace
|
||||||
|
|
||||||
|
# Version variables
|
||||||
|
NSSM_VERSION="nssm-2.24-101-g897c7ad"
|
||||||
|
NSSM_URL="https://nssm.cc/ci/${NSSM_VERSION}.zip"
|
||||||
|
FFMPEG_VERSION="ffmpeg-4.0.2-win64-static"
|
||||||
|
FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win64/static/${FFMPEG_VERSION}.zip"
|
||||||
|
|
||||||
|
# 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 binary
|
||||||
|
dotnet publish --configuration Release --self-contained --runtime win-x64 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true"
|
||||||
|
|
||||||
|
# Prepare addins
|
||||||
|
addin_build_dir="$( mktemp -d )"
|
||||||
|
wget ${NSSM_URL} -O ${addin_build_dir}/nssm.zip
|
||||||
|
wget ${FFMPEG_URL} -O ${addin_build_dir}/ffmpeg.zip
|
||||||
|
unzip ${addin_build_dir}/nssm.zip -d ${addin_build_dir}
|
||||||
|
cp ${addin_build_dir}/${NSSM_VERSION}/win64/nssm.exe /dist/jellyfin_${version}/nssm.exe
|
||||||
|
unzip ${addin_build_dir}/ffmpeg.zip -d ${addin_build_dir}
|
||||||
|
cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffmpeg.exe /dist/jellyfin_${version}/ffmpeg.exe
|
||||||
|
cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffprobe.exe /dist/jellyfin_${version}/ffprobe.exe
|
||||||
|
rm -rf ${addin_build_dir}
|
||||||
|
|
||||||
|
# Prepare scripts
|
||||||
|
cp ${SOURCE_DIR}/deployment/windows/legacy/install-jellyfin.ps1 /dist/jellyfin_${version}/install-jellyfin.ps1
|
||||||
|
cp ${SOURCE_DIR}/deployment/windows/legacy/install.bat /dist/jellyfin_${version}/install.bat
|
||||||
|
|
||||||
|
# Create zip package
|
||||||
|
pushd /dist
|
||||||
|
zip /jellyfin_${version}.portable.zip jellyfin_${version}
|
||||||
|
popd
|
||||||
|
rm -rf /dist/jellyfin_${version}
|
||||||
|
|
||||||
|
# Move the artifacts out
|
||||||
|
mkdir -p ${ARTIFACT_DIR}/
|
||||||
|
mv /jellyfin[-_]*.zip ${ARTIFACT_DIR}/
|
||||||
|
chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}
|
@ -1,47 +1,34 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -x
|
|
||||||
package_win64() (
|
|
||||||
local NSSM_VERSION="nssm-2.24-101-g897c7ad"
|
|
||||||
local NSSM_URL="https://nssm.cc/ci/${NSSM_VERSION}.zip"
|
|
||||||
local FFMPEG_VERSION="ffmpeg-4.0.2-win64-static"
|
|
||||||
local FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win64/static/${FFMPEG_VERSION}.zip"
|
|
||||||
local ROOT=${1-$DEFAULT_ROOT}
|
|
||||||
local OUTPUT_DIR=${2-$DEFAULT_OUTPUT_DIR}
|
|
||||||
local PKG_DIR=${3-$DEFAULT_PKG_DIR}
|
|
||||||
local ARCHIVE_CMD="zip -r"
|
|
||||||
# Package portable build result
|
|
||||||
if [ -d ${OUTPUT_DIR} ]; then
|
|
||||||
echo -e "${CYAN}Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}'.${NC}"
|
|
||||||
local TEMP_DIR="$(mktemp -d)"
|
|
||||||
wget ${NSSM_URL} -O ${TEMP_DIR}/nssm.zip
|
|
||||||
wget ${FFMPEG_URL} -O ${TEMP_DIR}/ffmpeg.zip
|
|
||||||
unzip ${TEMP_DIR}/nssm.zip -d $TEMP_DIR
|
|
||||||
cp ${TEMP_DIR}/${NSSM_VERSION}/win64/nssm.exe ${OUTPUT_DIR}/nssm.exe
|
|
||||||
unzip ${TEMP_DIR}/ffmpeg.zip -d $TEMP_DIR
|
|
||||||
cp ${TEMP_DIR}/${FFMPEG_VERSION}/bin/ffmpeg.exe ${OUTPUT_DIR}/ffmpeg.exe
|
|
||||||
cp ${TEMP_DIR}/${FFMPEG_VERSION}/bin/ffprobe.exe ${OUTPUT_DIR}/ffprobe.exe
|
|
||||||
rm -r ${TEMP_DIR}
|
|
||||||
cp ${ROOT}/deployment/windows/install-jellyfin.ps1 ${OUTPUT_DIR}/install-jellyfin.ps1
|
|
||||||
cp ${ROOT}/deployment/windows/install.bat ${OUTPUT_DIR}/install.bat
|
|
||||||
mkdir -p ${PKG_DIR}
|
|
||||||
pushd ${OUTPUT_DIR}
|
|
||||||
${ARCHIVE_CMD} ${ROOT}/${PKG_DIR}/`basename "${OUTPUT_DIR}"`.zip .
|
|
||||||
popd
|
|
||||||
local EXIT_CODE=$?
|
|
||||||
if [ $EXIT_CODE -eq 0 ]; then
|
|
||||||
echo -e "${GREEN}[DONE] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' complete.${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${RED}[FAIL] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' FAILED.${NC}"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo -e "${RED}[FAIL] Build artifacts do not exist for ${OUTPUT_DIR}. Run build.sh first.${NC}"
|
|
||||||
fi
|
|
||||||
)
|
|
||||||
|
|
||||||
source ../common.build.sh
|
args="${@}"
|
||||||
|
declare -a docker_envvars
|
||||||
|
for arg in ${args}; do
|
||||||
|
docker_envvars+=("-e ${arg}")
|
||||||
|
done
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
WORKDIR="$( pwd )"
|
||||||
|
|
||||||
package_win64 ../.. `pwd`/dist/jellyfin_${VERSION}
|
package_temporary_dir="${WORKDIR}/pkg-dist-tmp"
|
||||||
|
output_dir="${WORKDIR}/pkg-dist"
|
||||||
|
current_user="$( whoami )"
|
||||||
|
image_name="jellyfin-windows-x64-build"
|
||||||
|
|
||||||
|
# Determine if sudo should be used for Docker
|
||||||
|
if [[ ! -z $(id -Gn | grep -q 'docker') ]] \
|
||||||
|
&& [[ ! ${EUID:-1000} -eq 0 ]] \
|
||||||
|
&& [[ ! ${USER} == "root" ]] \
|
||||||
|
&& [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then
|
||||||
|
docker_sudo="sudo"
|
||||||
|
else
|
||||||
|
docker_sudo=""
|
||||||
|
fi
|
||||||
|
|
||||||
#TODO setup and maybe change above code to produce the Windows native zip format.
|
# Prepare temporary package dir
|
||||||
|
mkdir -p "${package_temporary_dir}"
|
||||||
|
# Set up the build environment Docker image
|
||||||
|
${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile
|
||||||
|
# Build the DEBs and copy out to ${package_temporary_dir}
|
||||||
|
${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars}
|
||||||
|
# Move the DEBs to the output directory
|
||||||
|
mkdir -p "${output_dir}"
|
||||||
|
mv "${package_temporary_dir}"/* "${output_dir}"
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
FROM debian:10
|
||||||
|
# Docker build arguments
|
||||||
|
ARG SOURCE_DIR=/jellyfin
|
||||||
|
ARG PLATFORM_DIR=/jellyfin/deployment/win-x86
|
||||||
|
ARG ARTIFACT_DIR=/dist
|
||||||
|
ARG SDK_VERSION=2.2
|
||||||
|
# Docker run environment
|
||||||
|
ENV SOURCE_DIR=/jellyfin
|
||||||
|
ENV ARTIFACT_DIR=/dist
|
||||||
|
ENV DEB_BUILD_OPTIONS=noddebs
|
||||||
|
ENV ARCH=amd64
|
||||||
|
|
||||||
|
# Prepare Debian build environment
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv libc6-dev libcurl4-openssl-dev libfontconfig1-dev libfreetype6-dev libssl-dev libssl1.1 liblttng-ust0 zip
|
||||||
|
|
||||||
|
# Install dotnet repository
|
||||||
|
# https://dotnet.microsoft.com/download/linux-package-manager/debian9/sdk-current
|
||||||
|
RUN wget https://download.visualstudio.microsoft.com/download/pr/228832ea-805f-45ab-8c88-fa36165701b9/16ce29a06031eeb09058dee94d6f5330/dotnet-sdk-2.2.401-linux-x64.tar.gz -O dotnet-sdk.tar.gz \
|
||||||
|
&& mkdir -p dotnet-sdk \
|
||||||
|
&& tar -xzf dotnet-sdk.tar.gz -C dotnet-sdk \
|
||||||
|
&& ln -s $( pwd )/dotnet-sdk/dotnet /usr/bin/dotnet
|
||||||
|
|
||||||
|
# Install yarn package manager
|
||||||
|
RUN wget -q -O- https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
|
||||||
|
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
|
||||||
|
&& apt update \
|
||||||
|
&& apt install -y yarn
|
||||||
|
|
||||||
|
# Link to docker-build script
|
||||||
|
RUN ln -sf ${PLATFORM_DIR}/docker-build.sh /docker-build.sh
|
||||||
|
|
||||||
|
VOLUME ${ARTIFACT_DIR}/
|
||||||
|
|
||||||
|
COPY . ${SOURCE_DIR}/
|
||||||
|
|
||||||
|
ENTRYPOINT ["/docker-build.sh"]
|
@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
source ../common.build.sh
|
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
|
||||||
|
|
||||||
build_jellyfin ../../Jellyfin.Server Release win-x86 `pwd`/dist/jellyfin_${VERSION}
|
|
@ -1,7 +1,27 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
source ../common.build.sh
|
keep_artifacts="${1}"
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
WORKDIR="$( pwd )"
|
||||||
|
|
||||||
clean_jellyfin ../.. Release `pwd`/dist/jellyfin_${VERSION}
|
package_temporary_dir="${WORKDIR}/pkg-dist-tmp"
|
||||||
|
output_dir="${WORKDIR}/pkg-dist"
|
||||||
|
current_user="$( whoami )"
|
||||||
|
image_name="jellyfin-windows-x86-build"
|
||||||
|
|
||||||
|
rm -rf "${package_temporary_dir}" &>/dev/null \
|
||||||
|
|| sudo rm -rf "${package_temporary_dir}" &>/dev/null
|
||||||
|
|
||||||
|
rm -rf "${output_dir}" &>/dev/null \
|
||||||
|
|| sudo rm -rf "${output_dir}" &>/dev/null
|
||||||
|
|
||||||
|
if [[ ${keep_artifacts} == 'n' ]]; then
|
||||||
|
docker_sudo=""
|
||||||
|
if [[ ! -z $(id -Gn | grep -q 'docker') ]] \
|
||||||
|
&& [[ ! ${EUID:-1000} -eq 0 ]] \
|
||||||
|
&& [[ ! ${USER} == "root" ]] \
|
||||||
|
&& [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then
|
||||||
|
docker_sudo=sudo
|
||||||
|
fi
|
||||||
|
${docker_sudo} docker image rm ${image_name} --force
|
||||||
|
fi
|
||||||
|
@ -1 +1 @@
|
|||||||
dotnet
|
docker
|
||||||
|
@ -0,0 +1,61 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Builds the ZIP archive inside the Docker container
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
set -o xtrace
|
||||||
|
|
||||||
|
# Version variables
|
||||||
|
NSSM_VERSION="nssm-2.24-101-g897c7ad"
|
||||||
|
NSSM_URL="https://nssm.cc/ci/${NSSM_VERSION}.zip"
|
||||||
|
FFMPEG_VERSION="ffmpeg-4.0.2-win32-static"
|
||||||
|
FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win32/static/${FFMPEG_VERSION}.zip"
|
||||||
|
|
||||||
|
# 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 binary
|
||||||
|
dotnet publish --configuration Release --self-contained --runtime win-x86 --output /dist/jellyfin_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true"
|
||||||
|
|
||||||
|
# Prepare addins
|
||||||
|
addin_build_dir="$( mktemp -d )"
|
||||||
|
wget ${NSSM_URL} -O ${addin_build_dir}/nssm.zip
|
||||||
|
wget ${FFMPEG_URL} -O ${addin_build_dir}/ffmpeg.zip
|
||||||
|
unzip ${addin_build_dir}/nssm.zip -d ${addin_build_dir}
|
||||||
|
cp ${addin_build_dir}/${NSSM_VERSION}/win64/nssm.exe /dist/jellyfin_${version}/nssm.exe
|
||||||
|
unzip ${addin_build_dir}/ffmpeg.zip -d ${addin_build_dir}
|
||||||
|
cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffmpeg.exe /dist/jellyfin_${version}/ffmpeg.exe
|
||||||
|
cp ${addin_build_dir}/${FFMPEG_VERSION}/bin/ffprobe.exe /dist/jellyfin_${version}/ffprobe.exe
|
||||||
|
rm -rf ${addin_build_dir}
|
||||||
|
|
||||||
|
# Prepare scripts
|
||||||
|
cp ${SOURCE_DIR}/deployment/windows/legacy/install-jellyfin.ps1 /dist/jellyfin_${version}/install-jellyfin.ps1
|
||||||
|
cp ${SOURCE_DIR}/deployment/windows/legacy/install.bat /dist/jellyfin_${version}/install.bat
|
||||||
|
|
||||||
|
# Create zip package
|
||||||
|
pushd /dist
|
||||||
|
zip /jellyfin_${version}.portable.zip jellyfin_${version}
|
||||||
|
popd
|
||||||
|
rm -rf /dist/jellyfin_${version}
|
||||||
|
|
||||||
|
# Move the artifacts out
|
||||||
|
mkdir -p ${ARTIFACT_DIR}/
|
||||||
|
mv /jellyfin[-_]*.zip ${ARTIFACT_DIR}/
|
||||||
|
chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}
|
@ -1,45 +1,34 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
package_win32() (
|
|
||||||
local NSSM_VERSION="nssm-2.24-101-g897c7ad"
|
|
||||||
local NSSM_URL="https://nssm.cc/ci/${NSSM_VERSION}.zip"
|
|
||||||
local FFMPEG_VERSION="ffmpeg-4.0.2-win32-static"
|
|
||||||
local FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win32/static/${FFMPEG_VERSION}.zip"
|
|
||||||
local ROOT=${1-$DEFAULT_ROOT}
|
|
||||||
local OUTPUT_DIR=${2-$DEFAULT_OUTPUT_DIR}
|
|
||||||
local PKG_DIR=${3-$DEFAULT_PKG_DIR}
|
|
||||||
local ARCHIVE_CMD="zip -r"
|
|
||||||
# Package portable build result
|
|
||||||
if [ -d ${OUTPUT_DIR} ]; then
|
|
||||||
echo -e "${CYAN}Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}'.${NC}"
|
|
||||||
local TEMP_DIR="$(mktemp -d)"
|
|
||||||
wget ${NSSM_URL} -O ${TEMP_DIR}/nssm.zip
|
|
||||||
wget ${FFMPEG_URL} -O ${TEMP_DIR}/ffmpeg.zip
|
|
||||||
unzip ${TEMP_DIR}/nssm.zip -d $TEMP_DIR
|
|
||||||
cp ${TEMP_DIR}/${NSSM_VERSION}/win32/nssm.exe ${OUTPUT_DIR}/nssm.exe
|
|
||||||
unzip ${TEMP_DIR}/ffmpeg.zip -d $TEMP_DIR
|
|
||||||
cp ${TEMP_DIR}/${FFMPEG_VERSION}/bin/ffmpeg.exe ${OUTPUT_DIR}/ffmpeg.exe
|
|
||||||
cp ${TEMP_DIR}/${FFMPEG_VERSION}/bin/ffprobe.exe ${OUTPUT_DIR}/ffprobe.exe
|
|
||||||
rm -r ${TEMP_DIR}
|
|
||||||
cp ${ROOT}/deployment/windows/install-jellyfin.ps1 ${OUTPUT_DIR}/install-jellyfin.ps1
|
|
||||||
cp ${ROOT}/deployment/windows/install.bat ${OUTPUT_DIR}/install.bat
|
|
||||||
mkdir -p ${PKG_DIR}
|
|
||||||
pushd ${OUTPUT_DIR}
|
|
||||||
${ARCHIVE_CMD} ${ROOT}/${PKG_DIR}/`basename "${OUTPUT_DIR}"`.zip .
|
|
||||||
popd
|
|
||||||
local EXIT_CODE=$?
|
|
||||||
if [ $EXIT_CODE -eq 0 ]; then
|
|
||||||
echo -e "${GREEN}[DONE] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' complete.${NC}"
|
|
||||||
else
|
|
||||||
echo -e "${RED}[FAIL] Packaging build in '${OUTPUT_DIR}' for `basename "${OUTPUT_DIR}"` to '${PKG_DIR}' with root '${ROOT}' FAILED.${NC}"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo -e "${RED}[FAIL] Build artifacts do not exist for ${OUTPUT_DIR}. Run build.sh first.${NC}"
|
|
||||||
fi
|
|
||||||
)
|
|
||||||
source ../common.build.sh
|
|
||||||
|
|
||||||
VERSION=`get_version ../..`
|
args="${@}"
|
||||||
|
declare -a docker_envvars
|
||||||
|
for arg in ${args}; do
|
||||||
|
docker_envvars+=("-e ${arg}")
|
||||||
|
done
|
||||||
|
|
||||||
package_win32 ../.. `pwd`/dist/jellyfin_${VERSION}
|
WORKDIR="$( pwd )"
|
||||||
|
|
||||||
|
package_temporary_dir="${WORKDIR}/pkg-dist-tmp"
|
||||||
|
output_dir="${WORKDIR}/pkg-dist"
|
||||||
|
current_user="$( whoami )"
|
||||||
|
image_name="jellyfin-windows-x86-build"
|
||||||
|
|
||||||
|
# Determine if sudo should be used for Docker
|
||||||
|
if [[ ! -z $(id -Gn | grep -q 'docker') ]] \
|
||||||
|
&& [[ ! ${EUID:-1000} -eq 0 ]] \
|
||||||
|
&& [[ ! ${USER} == "root" ]] \
|
||||||
|
&& [[ ! -z $( echo "${OSTYPE}" | grep -q "darwin" ) ]]; then
|
||||||
|
docker_sudo="sudo"
|
||||||
|
else
|
||||||
|
docker_sudo=""
|
||||||
|
fi
|
||||||
|
|
||||||
#TODO setup and maybe change above code to produce the Windows native zip format.
|
# Prepare temporary package dir
|
||||||
|
mkdir -p "${package_temporary_dir}"
|
||||||
|
# Set up the build environment Docker image
|
||||||
|
${docker_sudo} docker build ../.. -t "${image_name}" -f ./Dockerfile
|
||||||
|
# Build the DEBs and copy out to ${package_temporary_dir}
|
||||||
|
${docker_sudo} docker run --rm -v "${package_temporary_dir}:/dist" "${image_name}" ${docker_envvars}
|
||||||
|
# Move the DEBs to the output directory
|
||||||
|
mkdir -p "${output_dir}"
|
||||||
|
mv "${package_temporary_dir}"/* "${output_dir}"
|
||||||
|
Loading…
Reference in new issue