2018-12-14 05:57:50 +00:00
|
|
|
#!/usr/bin/env sh
|
2018-12-14 04:28:04 +00:00
|
|
|
|
|
|
|
# Build a Jellyfin .deb file with Docker on Linux
|
|
|
|
# Places the output .deb file in the parent directory
|
|
|
|
|
2018-12-15 00:00:19 +00:00
|
|
|
set -o errexit
|
2018-12-14 04:28:04 +00:00
|
|
|
set -o xtrace
|
|
|
|
set -o nounset
|
|
|
|
|
2018-12-14 05:57:50 +00:00
|
|
|
package_temporary_dir="`mktemp -d`"
|
|
|
|
current_user="`whoami`"
|
|
|
|
image_name="jellyfin-debuild"
|
2018-12-14 04:28:04 +00:00
|
|
|
|
2018-12-14 05:57:50 +00:00
|
|
|
cleanup() {
|
2018-12-15 00:00:19 +00:00
|
|
|
set +o errexit
|
2018-12-14 05:57:50 +00:00
|
|
|
docker image rm $image_name --force
|
2018-12-15 00:00:19 +00:00
|
|
|
rm -rf "$package_temporary_dir"
|
2018-12-14 05:57:50 +00:00
|
|
|
}
|
2018-12-14 23:57:12 +00:00
|
|
|
trap cleanup EXIT INT
|
2018-12-14 05:57:50 +00:00
|
|
|
|
2018-12-15 00:00:19 +00:00
|
|
|
docker build . -t "$image_name" -f ./Dockerfile.debian_package
|
|
|
|
docker run --rm -v "$package_temporary_dir:/temp" "$image_name" cp -r /dist /temp/
|
|
|
|
sudo chown -R "$current_user" "$package_temporary_dir"
|
|
|
|
mv "$package_temporary_dir"/dist/*.deb ../
|