The Free Software Media System - Server Backend & API
Clean up deployment directory
Joshua Boniface172a81b22c71
diff --git a/deployment/README.md b/deployment/README.mdindex a00cd3e6c2..a805f59ca3 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 plaThese 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 `<platform>/pkg-dist` directory.* Output files will be moved to the directory `jellyfin-build/<platform>` 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.shindex 7278372e18..31455de0d4 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.shindex 1b2d0bd733..0fd3e21093 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_envvarsfor arg in ${args}; dodiff --git a/deployment/common.build.sh b/deployment/common.build.shdeleted file mode 100755index 000872ea91..0000000000--- 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.shindex ac143c3d0b..e7bfdf8b4b 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.shindex acf3695d13..2091982187 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_envvarsfor arg in ${args}; dodiff --git a/deployment/debian-package-armhf/clean.sh b/deployment/debian-package-armhf/clean.shindex 3898110aff..35a3d3e9ad 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.shindex 35ee51a7ce..4a27dd8283 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_envvarsfor arg in ${args}; dodiff --git a/deployment/debian-package-x64/clean.sh b/deployment/debian-package-x64/clean.shindex b2960fcb3a..4e507bcb27 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.shindex 7e9e9e7a81..5a416959ab 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_envvarsfor arg in ${args}; dodiff --git a/deployment/docker/build.sh b/deployment/docker/build.shdeleted file mode 100755index 444208c85c..0000000000--- 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.txtdeleted file mode 100644index bdb9670965..0000000000--- a/deployment/docker/dependencies.txt+++ /dev/null@@ -1 +0,0 @@-dockerdiff --git a/deployment/docker/package.sh b/deployment/docker/package.shdeleted file mode 100755index d74426e2fe..0000000000--- 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.shindex 408167e49b..700c8f1bb3 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.shindex e8301c9897..62a3365b2b 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.shindex ee54fe8bec..93bdc447eb 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_envvarsfor arg in ${args}; dodiff --git a/deployment/ubuntu-package-arm64/clean.sh b/deployment/ubuntu-package-arm64/clean.shindex c92c7fdec6..82d427f9e5 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.shindex 1c9fada345..d1140a7274 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_envvarsfor arg in ${args}; dodiff --git a/deployment/ubuntu-package-armhf/clean.sh b/deployment/ubuntu-package-armhf/clean.shindex c92c7fdec6..82d427f9e5 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.shindex 2b3b014ffa..2ceb3e8165 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_envvarsfor arg in ${args}; dodiff --git a/deployment/ubuntu-package-x64/clean.sh b/deployment/ubuntu-package-x64/clean.shindex c92c7fdec6..82d427f9e5 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.shindex 599336671b..08c003778b 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_envvarsfor arg in ${args}; do