diff options
Diffstat (limited to 'deployment')
21 files changed, 149 insertions, 104 deletions
diff --git a/deployment/README.md b/deployment/README.md index 3400fd840..05b4ed51e 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -1,8 +1,111 @@ -# Build scripts +# Jellyfin Packaging -All `build.sh` and `package.sh` scripts are for *nix platforms (or WSL on Windows 10). +This directory contains the packaging configuration of Jellyfin for multiple platforms. The specification is below; all package platforms must follow the specification to be compatable with the central `build` script. -After running both, check the `*/pkg-dist/` folders for the archives and packages. +## Package List + +### Operating System Packages + +* `debian-package-x64`: Package for Debian and Ubuntu amd64 systems. +* `fedora-package-x64`: Package for Fedora, CentOS, and Red Hat Enterprise Linux amd64 systems. + +### 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. +* `win-x64`: Portable binary archive for Windows amd64 systems. +* `win-x86`: Portable binary archive for Windows i386 systems. + +### Other Builds + +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. +* `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. + +## Package Specification + +### Dependencies + +* If a platform requires additional build dependencies, the required binary names, i.e. to validate `which <binary>`, should be specified in a `dependencies.txt` file inside the platform directory. + +* Each dependency should be present on its own line. + +### Action Scripts + +* Actions are defined in BASH scripts with the name `<action>.sh` within the platform directory. + +* The list of valid actions are: + + 1. `build`: Builds a set of binaries. + 2. `package`: Assembles the compiled binaries into a package. + 3. `sign`: Performs signing actions on a package. + 4. `publish`: Performs a publishing action for a package. + 5. `clean`: Cleans up any artifacts from the previous actions. + +* All package actions are optional, however at least one should generate output files, and any that do should contain a `clean` action. + +* Actions are executed in the order specified above, and later actions may depend on former actions. + +* Actions except for `clean` should `set -o errexit` to terminate on failed actions. + +* The `clean` action should always `exit 0` even if no work is done or it fails. + +### Output Files + +* 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` -`build_all.sh` will invoke every build and package script. -Use `collect_all.sh` to copy all artifact to one directory for easy uploading. diff --git a/deployment/clean.sh b/deployment/clean.sh deleted file mode 100755 index 7517cf849..000000000 --- a/deployment/clean.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Execute every clean.sh scripts in every folder. -echo "Running for platforms '$@'." -for directory in */ ; do - platform=`basename "${directory}"` - if [[ $@ == *"$platform"* || $@ = *"all"* ]]; then - echo "Processing ${platform}" - pushd "$platform" - if [ -f clean.sh ]; then - echo ./clean.sh - fi - popd - else - echo "Skipping $platform." - fi -done - -rm -rf ./collect-dist diff --git a/deployment/collect_all.sh b/deployment/collect_all.sh deleted file mode 100755 index 69babe55e..000000000 --- a/deployment/collect_all.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -source common.build.sh - -VERSION=`get_version ..` - -COLLECT_DIR="./collect-dist" - -mkdir -p ./collect-dist - -DIRS=`find . -type d -name "pkg-dist"` - -while read directory -do - echo "Collecting everything from '$directory'.." - PLATFORM=$(basename "$(dirname "$directory")") - # Copy all artifacts with extensions tar.gz, deb, exe, zip, rpm and add the platform name to resolve any duplicates. - find $directory \( -name "jellyfin*.tar.gz" -o -name "jellyfin*.deb" -o -name "jellyfin*.rpm" -o -name "jellyfin*.zip" -o -name "jellyfin*.exe" \) -exec sh -c 'cp "$1" "'${COLLECT_DIR}'/jellyfin_'${PLATFORM}'_${1#*jellyfin}"' _ {} \; - -done <<< "${DIRS}" diff --git a/deployment/common.build.sh b/deployment/common.build.sh index a368928ba..7392fd401 100755 --- a/deployment/common.build.sh +++ b/deployment/common.build.sh @@ -16,6 +16,16 @@ DEFAULT_OUTPUT_DIR="dist/jellyfin-git" DEFAULT_PKG_DIR="pkg-dist" DEFAULT_DOCKERFILE="Dockerfile" DEFAULT_IMAGE_TAG="jellyfin:"`git rev-parse --abbrev-ref HEAD` +DEFAULT_ARCHIVE_CMD="tar -xvzf" + +# Parse the version from the AssemblyVersion +get_version() +( + local ROOT=${1-$DEFAULT_ROOT} + grep "AssemblyVersion" ${ROOT}/SharedVersion.cs \ + | sed -E 's/\[assembly: ?AssemblyVersion\("([0-9\.]+)"\)\]/\1/' \ + | sed -E 's/.0$//' +) # Run a build build_jellyfin() @@ -77,19 +87,13 @@ clean_jellyfin() fi ) -# Parse the version from the AssemblyVersion -get_version() -( - local ROOT=${1-$DEFAULT_ROOT} - grep "AssemblyVersion" ${ROOT}/SharedVersion.cs | sed -E 's/\[assembly: ?AssemblyVersion\("([0-9\.]+)"\)\]/\1/' | sed -E 's/.0$//' -) - # 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}" diff --git a/deployment/debian-package-x64/dependencies.txt b/deployment/debian-package-x64/dependencies.txt new file mode 100644 index 000000000..bdb967096 --- /dev/null +++ b/deployment/debian-package-x64/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/debian-package-x64/pkg-src/changelog b/deployment/debian-package-x64/pkg-src/changelog index f7a1994b7..825412d89 100644 --- a/deployment/debian-package-x64/pkg-src/changelog +++ b/deployment/debian-package-x64/pkg-src/changelog @@ -6,6 +6,8 @@ jellyfin (10.0.2-1) unstable; urgency=medium * #541: Change ItemId to Guid in ProviderManager * #566: Avoid printing stacktrace when bind to port 1900 fails + -- Joshua Boniface <joshua@boniface.me> Sat, 19 Jan 2019 01:19:59 -0500 + jellyfin (10.0.1-1) unstable; urgency=medium * Hotfix release, corrects several small bugs from 10.0.0 diff --git a/deployment/debian-package-x64/pkg-src/conf/logging.json b/deployment/debian-package-x64/pkg-src/conf/logging.json index 5d98484cd..f32b2089e 100644 --- a/deployment/debian-package-x64/pkg-src/conf/logging.json +++ b/deployment/debian-package-x64/pkg-src/conf/logging.json @@ -2,7 +2,8 @@ "Serilog": { "MinimumLevel": "Information", "WriteTo": [ - { "Name": "Console", + { + "Name": "Console", "Args": { "outputTemplate": "[{Timestamp:HH:mm:ss}] [{Level:u3}] {Message:lj}{NewLine}{Exception}" } diff --git a/deployment/debian-x64/dependencies.txt b/deployment/debian-x64/dependencies.txt new file mode 100644 index 000000000..3d25d1bdf --- /dev/null +++ b/deployment/debian-x64/dependencies.txt @@ -0,0 +1 @@ +dotnet diff --git a/deployment/docker/dependencies.txt b/deployment/docker/dependencies.txt new file mode 100644 index 000000000..bdb967096 --- /dev/null +++ b/deployment/docker/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/fedora-package-x64/dependencies.txt b/deployment/fedora-package-x64/dependencies.txt new file mode 100644 index 000000000..bdb967096 --- /dev/null +++ b/deployment/fedora-package-x64/dependencies.txt @@ -0,0 +1 @@ +docker diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin-firewalld.xml b/deployment/fedora-package-x64/pkg-src/jellyfin-firewalld.xml index 062db370d..538c5d65f 100644 --- a/deployment/fedora-package-x64/pkg-src/jellyfin-firewalld.xml +++ b/deployment/fedora-package-x64/pkg-src/jellyfin-firewalld.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <service> - <short>Jellyfin</short> - <description>The Free Software Media System.</description> - <port protocol="tcp" port="8096"/> - <port protocol="tcp" port="8920"/> - <port protocol="udp" port="1900"/> - <port protocol="udp" port="7359"/> -</service>
\ No newline at end of file + <short>Jellyfin</short> + <description>The Free Software Media System.</description> + <port protocol="tcp" port="8096"/> + <port protocol="tcp" port="8920"/> + <port protocol="udp" port="1900"/> + <port protocol="udp" port="7359"/> +</service> diff --git a/deployment/fedora-package-x64/pkg-src/jellyfin.spec b/deployment/fedora-package-x64/pkg-src/jellyfin.spec index acab6b13b..e304fe442 100644 --- a/deployment/fedora-package-x64/pkg-src/jellyfin.spec +++ b/deployment/fedora-package-x64/pkg-src/jellyfin.spec @@ -1,13 +1,13 @@ %global debug_package %{nil} # jellyfin tag to package -%global gittag v10.0.1 +%global gittag v10.0.2 # Taglib-sharp commit of the submodule since github archive doesn't include submodules %global taglib_commit ee5ab21742b71fd1b87ee24895582327e9e04776 %global taglib_shortcommit %(c=%{taglib_commit}; echo ${c:0:7}) AutoReq: no Name: jellyfin -Version: 10.0.1 +Version: 10.0.2 Release: 1%{?dist} Summary: The Free Software Media Browser License: GPLv2 diff --git a/deployment/linux-x64/dependencies.txt b/deployment/linux-x64/dependencies.txt new file mode 100644 index 000000000..3d25d1bdf --- /dev/null +++ b/deployment/linux-x64/dependencies.txt @@ -0,0 +1 @@ +dotnet diff --git a/deployment/make.sh b/deployment/make.sh deleted file mode 100755 index 6b8d8de08..000000000 --- a/deployment/make.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -git submodule update --init --recursive - -pushd ../Jellyfin.Versioning -./update-version -popd - -#TODO enabled proper flag parsing for enabling and disabling building, signing, packaging and publishing - -# Execute all build.sh, package.sh, sign.sh and publish.sh scripts in every folder. In that order. Script should check for artifacts themselves. -echo "Running for platforms '$@'." -for directory in */ ; do - platform=`basename "${directory}"` - if [[ $@ == *"$platform"* || $@ = *"all"* ]]; then - echo "Processing ${platform}" - pushd "$platform" - if [ -f build.sh ]; then - ./build.sh - fi - if [ -f package.sh ]; then - ./package.sh - fi - if [ -f sign.sh ]; then - ./sign.sh - fi - if [ -f publish.sh ]; then - ./publish.sh - fi - popd - else - echo "Skipping $platform." - fi -done diff --git a/deployment/osx-x64/dependencies.txt b/deployment/osx-x64/dependencies.txt new file mode 100644 index 000000000..3d25d1bdf --- /dev/null +++ b/deployment/osx-x64/dependencies.txt @@ -0,0 +1 @@ +dotnet diff --git a/deployment/ubuntu-x64/dependencies.txt b/deployment/ubuntu-x64/dependencies.txt new file mode 100644 index 000000000..3d25d1bdf --- /dev/null +++ b/deployment/ubuntu-x64/dependencies.txt @@ -0,0 +1 @@ +dotnet diff --git a/deployment/unraid/docker-templates/jellyfin.xml b/deployment/unraid/docker-templates/jellyfin.xml index be1188424..1d97a9f00 100644 --- a/deployment/unraid/docker-templates/jellyfin.xml +++ b/deployment/unraid/docker-templates/jellyfin.xml @@ -23,7 +23,7 @@ <Project>https://jellyfin.media/</Project> <BindTime>true</BindTime> <Privileged>false</Privileged> - <Networking> + <Networking> <Mode>host</Mode> <Publish> <Port> @@ -32,7 +32,7 @@ <Protocol>tcp</Protocol> </Port> </Publish> - </Networking> + </Networking> <Data> <Volume> <HostDir>/mnt/cache/appdata/config</HostDir> diff --git a/deployment/win-generic/build-jellyfin.ps1 b/deployment/win-generic/build-jellyfin.ps1 index 4f0f92525..7807a46c3 100644 --- a/deployment/win-generic/build-jellyfin.ps1 +++ b/deployment/win-generic/build-jellyfin.ps1 @@ -1,4 +1,4 @@ -[CmdletBinding()] +[CmdletBinding()] param( [switch]$InstallFFMPEG, [switch]$InstallNSSM, @@ -37,7 +37,7 @@ function Install-FFMPEG { Write-Verbose "Checking Architecture" if($Architecture -notin @('x86','x64')){ Write-Warning "No builds available for your selected architecture of $Architecture" - Write-Warning "FFMPEG will not be installed" + Write-Warning "FFMPEG will not be installed" }elseif($Architecture -eq 'x64'){ Write-Verbose "Downloading 64 bit FFMPEG" Invoke-WebRequest -Uri https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-4.1-win64-static.zip -UseBasicParsing -OutFile "$tempdir/fmmpeg.zip" | Write-Verbose @@ -45,7 +45,7 @@ function Install-FFMPEG { Write-Verbose "Downloading 32 bit FFMPEG" Invoke-WebRequest -Uri https://ffmpeg.zeranoe.com/builds/win32/static/ffmpeg-4.1-win32-static.zip -UseBasicParsing -OutFile "$tempdir/fmmpeg.zip" | Write-Verbose } - + Expand-Archive "$tempdir/fmmpeg.zip" -DestinationPath "$tempdir/ffmpeg/" | Write-Verbose if($Architecture -eq 'x64'){ Write-Verbose "Copying Binaries to Jellyfin location" @@ -70,12 +70,12 @@ function Install-NSSM { Write-Verbose "Checking Architecture" if($Architecture -notin @('x86','x64')){ Write-Warning "No builds available for your selected architecture of $Architecture" - Write-Warning "NSSM will not be installed" + Write-Warning "NSSM will not be installed" }else{ Write-Verbose "Downloading NSSM" Invoke-WebRequest -Uri https://nssm.cc/ci/nssm-2.24-101-g897c7ad.zip -UseBasicParsing -OutFile "$tempdir/nssm.zip" | Write-Verbose } - + Expand-Archive "$tempdir/nssm.zip" -DestinationPath "$tempdir/nssm/" | Write-Verbose if($Architecture -eq 'x64'){ Write-Verbose "Copying Binaries to Jellyfin location" diff --git a/deployment/win-generic/dependencies.txt b/deployment/win-generic/dependencies.txt new file mode 100644 index 000000000..3d25d1bdf --- /dev/null +++ b/deployment/win-generic/dependencies.txt @@ -0,0 +1 @@ +dotnet diff --git a/deployment/win-x64/dependencies.txt b/deployment/win-x64/dependencies.txt new file mode 100644 index 000000000..3d25d1bdf --- /dev/null +++ b/deployment/win-x64/dependencies.txt @@ -0,0 +1 @@ +dotnet diff --git a/deployment/win-x86/dependencies.txt b/deployment/win-x86/dependencies.txt new file mode 100644 index 000000000..3d25d1bdf --- /dev/null +++ b/deployment/win-x86/dependencies.txt @@ -0,0 +1 @@ +dotnet |
