aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2020-06-19 16:31:59 -0400
committerJoshua M. Boniface <joshua@boniface.me>2020-06-19 16:31:59 -0400
commita418c248061362379b43624128f6cd15a4acb193 (patch)
tree8e58b692e4c4dd19a33592e14be980fe6f0b00cc
parent3599ae7186a066e259bda7cd0156b0a891d76750 (diff)
Modify build scripts to build Unstable versions
-rwxr-xr-xdeployment/build.centos.amd6416
-rwxr-xr-xdeployment/build.debian.amd6415
-rwxr-xr-xdeployment/build.debian.arm6415
-rwxr-xr-xdeployment/build.debian.armhf15
-rwxr-xr-xdeployment/build.fedora.amd6416
-rwxr-xr-xdeployment/build.linux.amd646
-rwxr-xr-xdeployment/build.macos6
-rwxr-xr-xdeployment/build.portable6
-rwxr-xr-xdeployment/build.ubuntu.amd6415
-rwxr-xr-xdeployment/build.ubuntu.arm6415
-rwxr-xr-xdeployment/build.ubuntu.armhf15
-rwxr-xr-xdeployment/build.windows.amd646
12 files changed, 142 insertions, 4 deletions
diff --git a/deployment/build.centos.amd64 b/deployment/build.centos.amd64
index 939bbc45a..69f0cadcf 100755
--- a/deployment/build.centos.amd64
+++ b/deployment/build.centos.amd64
@@ -8,6 +8,22 @@ set -o xtrace
# Move to source directory
pushd ${SOURCE_DIR}
+# Modify changelog to unstable configuration if IS_UNSTABLE
+if [[ ${IS_UNSTABLE} == 'yes' ]]; then
+ pushd fedora
+
+ PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
+
+ sed -i "s/Version:.*/Version: ${BUILD_ID}/" jellyfin.spec
+ sed -i "/%changelog/q" jellyfin.spec
+
+ cat <<EOF >>jellyfin.spec
+* $( LANG=C date '+%a %b %d %Y' ) Jellyfin Packaging Team <packaging@jellyfin.org>
+- Jellyfin Server unstable build ${BUILD_ID} for merged PR #${PR_ID}
+EOF
+ popd
+fi
+
# Build RPM
make -f fedora/Makefile srpm outdir=/root/rpmbuild/SRPMS
rpmbuild --rebuild -bb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm
diff --git a/deployment/build.debian.amd64 b/deployment/build.debian.amd64
index f44c6a7d1..012e1cebf 100755
--- a/deployment/build.debian.amd64
+++ b/deployment/build.debian.amd64
@@ -14,6 +14,21 @@ if [[ ${IS_DOCKER} == YES ]]; then
sed -i '/dotnet-sdk-3.1,/d' debian/control
fi
+# Modify changelog to unstable configuration if IS_UNSTABLE
+if [[ ${IS_UNSTABLE} == 'yes' ]]; then
+ pushd debian
+ PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
+
+ cat <<EOF >changelog
+jellyfin-server (${BUILD_ID}-unstable) unstable; urgency=medium
+
+ * Jellyfin Server unstable build ${BUILD_ID} for merged PR #${PR_ID}
+
+ -- Jellyfin Packaging Team <packaging@jellyfin.org> $( date --rfc-2822 )
+EOF
+ popd
+fi
+
# Build DEB
dpkg-buildpackage -us -uc --pre-clean --post-clean
diff --git a/deployment/build.debian.arm64 b/deployment/build.debian.arm64
index 0127671f3..12ce3e874 100755
--- a/deployment/build.debian.arm64
+++ b/deployment/build.debian.arm64
@@ -14,6 +14,21 @@ if [[ ${IS_DOCKER} == YES ]]; then
sed -i '/dotnet-sdk-3.1,/d' debian/control
fi
+# Modify changelog to unstable configuration if IS_UNSTABLE
+if [[ ${IS_UNSTABLE} == 'yes' ]]; then
+ pushd debian
+ PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
+
+ cat <<EOF >changelog
+jellyfin-server (${BUILD_ID}-unstable) unstable; urgency=medium
+
+ * Jellyfin Server unstable build ${BUILD_ID} for merged PR #${PR_ID}
+
+ -- Jellyfin Packaging Team <packaging@jellyfin.org> $( date --rfc-2822 )
+EOF
+ popd
+fi
+
# Build DEB
export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH}
dpkg-buildpackage -us -uc -a arm64 --pre-clean --post-clean
diff --git a/deployment/build.debian.armhf b/deployment/build.debian.armhf
index 02e3db4fc..3089eab58 100755
--- a/deployment/build.debian.armhf
+++ b/deployment/build.debian.armhf
@@ -14,6 +14,21 @@ if [[ ${IS_DOCKER} == YES ]]; then
sed -i '/dotnet-sdk-3.1,/d' debian/control
fi
+# Modify changelog to unstable configuration if IS_UNSTABLE
+if [[ ${IS_UNSTABLE} == 'yes' ]]; then
+ pushd debian
+ PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
+
+ cat <<EOF >changelog
+jellyfin-server (${BUILD_ID}-unstable) unstable; urgency=medium
+
+ * Jellyfin Server unstable build ${BUILD_ID} for merged PR #${PR_ID}
+
+ -- Jellyfin Packaging Team <packaging@jellyfin.org> $( date --rfc-2822 )
+EOF
+ popd
+fi
+
# Build DEB
export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH}
dpkg-buildpackage -us -uc -a armhf --pre-clean --post-clean
diff --git a/deployment/build.fedora.amd64 b/deployment/build.fedora.amd64
index 8ac99decc..2c7bff506 100755
--- a/deployment/build.fedora.amd64
+++ b/deployment/build.fedora.amd64
@@ -8,6 +8,22 @@ set -o xtrace
# Move to source directory
pushd ${SOURCE_DIR}
+# Modify changelog to unstable configuration if IS_UNSTABLE
+if [[ ${IS_UNSTABLE} == 'yes' ]]; then
+ pushd fedora
+
+ PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
+
+ sed -i "s/Version:.*/Version: ${BUILD_ID}/" jellyfin.spec
+ sed -i "/%changelog/q" jellyfin.spec
+
+ cat <<EOF >>jellyfin.spec
+* $( LANG=C date '+%a %b %d %Y' ) Jellyfin Packaging Team <packaging@jellyfin.org>
+- Jellyfin Server unstable build ${BUILD_ID} for merged PR #${PR_ID}
+EOF
+ popd
+fi
+
# Build RPM
make -f fedora/Makefile srpm outdir=/root/rpmbuild/SRPMS
rpmbuild -rb /root/rpmbuild/SRPMS/jellyfin-*.src.rpm
diff --git a/deployment/build.linux.amd64 b/deployment/build.linux.amd64
index 0cbbd05cf..a7fb0544a 100755
--- a/deployment/build.linux.amd64
+++ b/deployment/build.linux.amd64
@@ -9,7 +9,11 @@ set -o xtrace
pushd ${SOURCE_DIR}
# Get version
-version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"
+if [[ ${IS_UNSTABLE} == 'yes' ]]; then
+ version="${BUILD_ID}"
+else
+ version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"
+fi
# Build archives
dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime linux-x64 --output dist/jellyfin-server_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true"
diff --git a/deployment/build.macos b/deployment/build.macos
index 16be29eee..d808141ac 100755
--- a/deployment/build.macos
+++ b/deployment/build.macos
@@ -9,7 +9,11 @@ set -o xtrace
pushd ${SOURCE_DIR}
# Get version
-version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"
+if [[ ${IS_UNSTABLE} == 'yes' ]]; then
+ version="${BUILD_ID}"
+else
+ version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"
+fi
# Build archives
dotnet publish Jellyfin.Server --configuration Release --self-contained --runtime osx-x64 --output dist/jellyfin-server_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true"
diff --git a/deployment/build.portable b/deployment/build.portable
index 1e8a4ab62..24a8cbf32 100755
--- a/deployment/build.portable
+++ b/deployment/build.portable
@@ -9,7 +9,11 @@ set -o xtrace
pushd ${SOURCE_DIR}
# Get version
-version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"
+if [[ ${IS_UNSTABLE} == 'yes' ]]; then
+ version="${BUILD_ID}"
+else
+ version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"
+fi
# Build archives
dotnet publish Jellyfin.Server --configuration Release --output dist/jellyfin-server_${version}/ "-p:GenerateDocumentationFile=false;DebugSymbols=false;DebugType=none;UseAppHost=true"
diff --git a/deployment/build.ubuntu.amd64 b/deployment/build.ubuntu.amd64
index 107ddbe02..0eac9cdd1 100755
--- a/deployment/build.ubuntu.amd64
+++ b/deployment/build.ubuntu.amd64
@@ -14,6 +14,21 @@ if [[ ${IS_DOCKER} == YES ]]; then
sed -i '/dotnet-sdk-3.1,/d' debian/control
fi
+# Modify changelog to unstable configuration if IS_UNSTABLE
+if [[ ${IS_UNSTABLE} == 'yes' ]]; then
+ pushd debian
+ PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
+
+ cat <<EOF >changelog
+jellyfin-server (${BUILD_ID}-unstable) unstable; urgency=medium
+
+ * Jellyfin Server unstable build ${BUILD_ID} for merged PR #${PR_ID}
+
+ -- Jellyfin Packaging Team <packaging@jellyfin.org> $( date --rfc-2822 )
+EOF
+ popd
+fi
+
# Build DEB
dpkg-buildpackage -us -uc --pre-clean --post-clean
diff --git a/deployment/build.ubuntu.arm64 b/deployment/build.ubuntu.arm64
index b13868f44..5b11fd543 100755
--- a/deployment/build.ubuntu.arm64
+++ b/deployment/build.ubuntu.arm64
@@ -14,6 +14,21 @@ if [[ ${IS_DOCKER} == YES ]]; then
sed -i '/dotnet-sdk-3.1,/d' debian/control
fi
+# Modify changelog to unstable configuration if IS_UNSTABLE
+if [[ ${IS_UNSTABLE} == 'yes' ]]; then
+ pushd debian
+ PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
+
+ cat <<EOF >changelog
+jellyfin-server (${BUILD_ID}-unstable) unstable; urgency=medium
+
+ * Jellyfin Server unstable build ${BUILD_ID} for merged PR #${PR_ID}
+
+ -- Jellyfin Packaging Team <packaging@jellyfin.org> $( date --rfc-2822 )
+EOF
+ popd
+fi
+
# Build DEB
export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH}
dpkg-buildpackage -us -uc -a arm64 --pre-clean --post-clean
diff --git a/deployment/build.ubuntu.armhf b/deployment/build.ubuntu.armhf
index 0b4dd308a..4734cf658 100755
--- a/deployment/build.ubuntu.armhf
+++ b/deployment/build.ubuntu.armhf
@@ -14,6 +14,21 @@ if [[ ${IS_DOCKER} == YES ]]; then
sed -i '/dotnet-sdk-3.1,/d' debian/control
fi
+# Modify changelog to unstable configuration if IS_UNSTABLE
+if [[ ${IS_UNSTABLE} == 'yes' ]]; then
+ pushd debian
+ PR_ID=$( git log --grep 'Merge pull request' --oneline --single-worktree --first-parent | head -1 | grep --color=none -Eo '#[0-9]+' | tr -d '#' )
+
+ cat <<EOF >changelog
+jellyfin-server (${BUILD_ID}-unstable) unstable; urgency=medium
+
+ * Jellyfin Server unstable build ${BUILD_ID} for merged PR #${PR_ID}
+
+ -- Jellyfin Packaging Team <packaging@jellyfin.org> $( date --rfc-2822 )
+EOF
+ popd
+fi
+
# Build DEB
export CONFIG_SITE=/etc/dpkg-cross/cross-config.${ARCH}
dpkg-buildpackage -us -uc -a armhf --pre-clean --post-clean
diff --git a/deployment/build.windows.amd64 b/deployment/build.windows.amd64
index 39bd41f99..3fabc2cac 100755
--- a/deployment/build.windows.amd64
+++ b/deployment/build.windows.amd64
@@ -15,7 +15,11 @@ FFMPEG_URL="https://ffmpeg.zeranoe.com/builds/win64/static/${FFMPEG_VERSION}.zip
pushd ${SOURCE_DIR}
# Get version
-version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"
+if [[ ${IS_UNSTABLE} == 'yes' ]]; then
+ version="${BUILD_ID}"
+else
+ version="$( grep "version:" ./build.yaml | sed -E 's/version: "([0-9\.]+.*)"/\1/' )"
+fi
output_dir="dist/jellyfin-server_${version}"