diff --git a/deployment/README.md b/deployment/README.md index a00cd3e6c..a805f59ca 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -11,10 +11,8 @@ This directory contains the packaging configuration of Jellyfin for multiple pla ### Portable Builds (archives) -* `debian-x64`: Portable binary archive for Debian amd64 systems. -* `ubuntu-x64`: Portable binary archive for Ubuntu amd64 systems. * `linux-x64`: Portable binary archive for generic Linux amd64 systems. -* `osx-x64`: Portable binary archive for MacOS amd64 systems. +* `macos`: Portable binary archive for MacOS amd64 systems. * `win-x64`: Portable binary archive for Windows amd64 systems. * `win-x86`: Portable binary archive for Windows i386 systems. @@ -22,10 +20,10 @@ This directory contains the packaging configuration of Jellyfin for multiple pla These builds are not necessarily run from the `build` script, but are present for other platforms. -* `framework`: Compiled `.dll` for use with .NET Core runtime on any system. +* `portable`: Compiled `.dll` for use with .NET Core runtime on any system. * `docker`: Docker manifests for auto-publishing. * `unraid`: unRaid Docker template; not built by `build` but imported into unRaid directly. -* `win-generic`: Portable binary for generic Windows systems. +* `windows`: Support files and scripts for Windows CI build. ## Package Specification @@ -62,52 +60,3 @@ These builds are not necessarily run from the `build` script, but are present fo * Upon completion of the defined actions, at least one output file must be created in the `/pkg-dist` directory. * Output files will be moved to the directory `jellyfin-build/` one directory above the repository root upon completion. - -### Common Functions - -* A number of common functions are defined in `deployment/common.build.sh` for use by platform scripts. - -* Each action script should import the common functions to define a number of standard variables. - -* The common variables are: - - * `ROOT`: The Jellyfin repostiory root, usually `../..`. - * `CONFIG`: The .NET config, usually `Release`. - * `DOTNETRUNTIME`: The .NET `--runtime` value, platform-dependent. - * `OUTPUT_DIR`: The intermediate output dir, usually `./dist/jellyfin_${VERSION}`. - * `BUILD_CONTEXT`: The Docker build context, usually `../..`. - * `DOCKERFILE`: The Dockerfile, usually `Dockerfile` in the platform directory. - * `IMAGE_TAG`: A tag for the built Docker image. - * `PKG_DIR`: The final binary output directory for collection, invariably `pkg-dist`. - * `ARCHIVE_CMD`: The compression/archive command for release archives, usually `tar -xvzf` or `zip`. - -#### `get_version` - -Reads the version information from `SharedVersion.cs`. - -**Arguments:** `ROOT` - -#### `build_jellyfin` - -Build a standard self-contained binary in the current OS context. - -**Arguments:** `ROOT` `CONFIG` `DOTNETRUNTIME` `OUTPUT_DIR` - -#### `build_jellyfin_docker` - -Build a standard self-contained binary in a Docker image. - -**Arguments:** `BUILD_CONTEXT` `DOCKERFILE` `IMAGE_TAG` - -#### `clean_jellyfin` - -Clean up a build for housekeeping. - -**Arguments:** `ROOT` `CONFIG` `OUTPUT_DIR` `PKG_DIR` - -#### `package_portable` - -Produce a compressed archive. - -**Arguments:** `ROOT` `OUTPUT_DIR` `PKG_DIR` `ARCHIVE_CMD` - diff --git a/deployment/centos-package-x64/clean.sh b/deployment/centos-package-x64/clean.sh index 7278372e1..31455de0d 100755 --- a/deployment/centos-package-x64/clean.sh +++ b/deployment/centos-package-x64/clean.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - keep_artifacts="${1}" WORKDIR="$( pwd )" diff --git a/deployment/centos-package-x64/package.sh b/deployment/centos-package-x64/package.sh index 1b2d0bd73..0fd3e2109 100755 --- a/deployment/centos-package-x64/package.sh +++ b/deployment/centos-package-x64/package.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - args="${@}" declare -a docker_envvars for arg in ${args}; do diff --git a/deployment/common.build.sh b/deployment/common.build.sh deleted file mode 100755 index 000872ea9..000000000 --- a/deployment/common.build.sh +++ /dev/null @@ -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 -) - diff --git a/deployment/debian-package-arm64/clean.sh b/deployment/debian-package-arm64/clean.sh index ac143c3d0..e7bfdf8b4 100755 --- a/deployment/debian-package-arm64/clean.sh +++ b/deployment/debian-package-arm64/clean.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - keep_artifacts="${1}" WORKDIR="$( pwd )" diff --git a/deployment/debian-package-arm64/package.sh b/deployment/debian-package-arm64/package.sh index acf3695d1..209198218 100755 --- a/deployment/debian-package-arm64/package.sh +++ b/deployment/debian-package-arm64/package.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - args="${@}" declare -a docker_envvars for arg in ${args}; do diff --git a/deployment/debian-package-armhf/clean.sh b/deployment/debian-package-armhf/clean.sh index 3898110af..35a3d3e9a 100755 --- a/deployment/debian-package-armhf/clean.sh +++ b/deployment/debian-package-armhf/clean.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - keep_artifacts="${1}" WORKDIR="$( pwd )" diff --git a/deployment/debian-package-armhf/package.sh b/deployment/debian-package-armhf/package.sh index 35ee51a7c..4a27dd828 100755 --- a/deployment/debian-package-armhf/package.sh +++ b/deployment/debian-package-armhf/package.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - args="${@}" declare -a docker_envvars for arg in ${args}; do diff --git a/deployment/debian-package-x64/clean.sh b/deployment/debian-package-x64/clean.sh index b2960fcb3..4e507bcb2 100755 --- a/deployment/debian-package-x64/clean.sh +++ b/deployment/debian-package-x64/clean.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - keep_artifacts="${1}" WORKDIR="$( pwd )" diff --git a/deployment/debian-package-x64/package.sh b/deployment/debian-package-x64/package.sh index 7e9e9e7a8..5a416959a 100755 --- a/deployment/debian-package-x64/package.sh +++ b/deployment/debian-package-x64/package.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - args="${@}" declare -a docker_envvars for arg in ${args}; do diff --git a/deployment/docker/build.sh b/deployment/docker/build.sh deleted file mode 100755 index 444208c85..000000000 --- a/deployment/docker/build.sh +++ /dev/null @@ -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} diff --git a/deployment/docker/dependencies.txt b/deployment/docker/dependencies.txt deleted file mode 100644 index bdb967096..000000000 --- a/deployment/docker/dependencies.txt +++ /dev/null @@ -1 +0,0 @@ -docker diff --git a/deployment/docker/package.sh b/deployment/docker/package.sh deleted file mode 100755 index d74426e2f..000000000 --- a/deployment/docker/package.sh +++ /dev/null @@ -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} diff --git a/deployment/fedora-package-x64/clean.sh b/deployment/fedora-package-x64/clean.sh index 408167e49..700c8f1bb 100755 --- a/deployment/fedora-package-x64/clean.sh +++ b/deployment/fedora-package-x64/clean.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - keep_artifacts="${1}" WORKDIR="$( pwd )" diff --git a/deployment/fedora-package-x64/create_tarball.sh b/deployment/fedora-package-x64/create_tarball.sh index e8301c989..62a3365b2 100755 --- a/deployment/fedora-package-x64/create_tarball.sh +++ b/deployment/fedora-package-x64/create_tarball.sh @@ -1,8 +1,6 @@ #!/usr/bin/env bash # shellcheck disable=SC1091 -source ../common.build.sh - WORKDIR="$( pwd )" VERSION="$( sed -ne '/^Version:/s/.* *//p' "${WORKDIR}"/pkg-src/jellyfin.spec )" diff --git a/deployment/fedora-package-x64/package.sh b/deployment/fedora-package-x64/package.sh index ee54fe8be..93bdc447e 100755 --- a/deployment/fedora-package-x64/package.sh +++ b/deployment/fedora-package-x64/package.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - args="${@}" declare -a docker_envvars for arg in ${args}; do diff --git a/deployment/ubuntu-package-arm64/clean.sh b/deployment/ubuntu-package-arm64/clean.sh index c92c7fdec..82d427f9e 100755 --- a/deployment/ubuntu-package-arm64/clean.sh +++ b/deployment/ubuntu-package-arm64/clean.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - keep_artifacts="${1}" WORKDIR="$( pwd )" diff --git a/deployment/ubuntu-package-arm64/package.sh b/deployment/ubuntu-package-arm64/package.sh index 1c9fada34..d1140a727 100755 --- a/deployment/ubuntu-package-arm64/package.sh +++ b/deployment/ubuntu-package-arm64/package.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - args="${@}" declare -a docker_envvars for arg in ${args}; do diff --git a/deployment/ubuntu-package-armhf/clean.sh b/deployment/ubuntu-package-armhf/clean.sh index c92c7fdec..82d427f9e 100755 --- a/deployment/ubuntu-package-armhf/clean.sh +++ b/deployment/ubuntu-package-armhf/clean.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - keep_artifacts="${1}" WORKDIR="$( pwd )" diff --git a/deployment/ubuntu-package-armhf/package.sh b/deployment/ubuntu-package-armhf/package.sh index 2b3b014ff..2ceb3e816 100755 --- a/deployment/ubuntu-package-armhf/package.sh +++ b/deployment/ubuntu-package-armhf/package.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - args="${@}" declare -a docker_envvars for arg in ${args}; do diff --git a/deployment/ubuntu-package-x64/clean.sh b/deployment/ubuntu-package-x64/clean.sh index c92c7fdec..82d427f9e 100755 --- a/deployment/ubuntu-package-x64/clean.sh +++ b/deployment/ubuntu-package-x64/clean.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - keep_artifacts="${1}" WORKDIR="$( pwd )" diff --git a/deployment/ubuntu-package-x64/package.sh b/deployment/ubuntu-package-x64/package.sh index 599336671..08c003778 100755 --- a/deployment/ubuntu-package-x64/package.sh +++ b/deployment/ubuntu-package-x64/package.sh @@ -1,7 +1,5 @@ #!/usr/bin/env bash -source ../common.build.sh - args="${@}" declare -a docker_envvars for arg in ${args}; do