Clean up deployment directory

1. Update README.md to remove some old info
2. Remove common.build.sh from all the build scripts
3. Remove common.build.sh script
4. Remove the docker folder as this isn't used at all
This commit is contained in:
Joshua Boniface 2019-09-25 01:28:07 -04:00
parent 5c7ca6b363
commit 172a81b22c
22 changed files with 3 additions and 223 deletions

View File

@ -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 `<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`

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
keep_artifacts="${1}"
WORKDIR="$( pwd )"

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
args="${@}"
declare -a docker_envvars
for arg in ${args}; do

View File

@ -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
)

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
keep_artifacts="${1}"
WORKDIR="$( pwd )"

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
args="${@}"
declare -a docker_envvars
for arg in ${args}; do

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
keep_artifacts="${1}"
WORKDIR="$( pwd )"

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
args="${@}"
declare -a docker_envvars
for arg in ${args}; do

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
keep_artifacts="${1}"
WORKDIR="$( pwd )"

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
args="${@}"
declare -a docker_envvars
for arg in ${args}; do

View File

@ -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}

View File

@ -1 +0,0 @@
docker

View File

@ -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}

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
keep_artifacts="${1}"
WORKDIR="$( pwd )"

View File

@ -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 )"

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
args="${@}"
declare -a docker_envvars
for arg in ${args}; do

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
keep_artifacts="${1}"
WORKDIR="$( pwd )"

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
args="${@}"
declare -a docker_envvars
for arg in ${args}; do

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
keep_artifacts="${1}"
WORKDIR="$( pwd )"

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
args="${@}"
declare -a docker_envvars
for arg in ${args}; do

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
keep_artifacts="${1}"
WORKDIR="$( pwd )"

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
source ../common.build.sh
args="${@}"
declare -a docker_envvars
for arg in ${args}; do