-
Notifications
You must be signed in to change notification settings - Fork 552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Autoupdate" feature. Update S6. Shellcheck. #81
Open
midzelis
wants to merge
15
commits into
plexinc:master
Choose a base branch
from
midzelis:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
156169f
Add multi-arch build/debug helper scripts
midzelis a09c55b
Upgrade to latest Ubuntu LTS (and fix arch base image)
midzelis 63c3c8c
Upgrade to s6-overlay v3
midzelis b0ae80d
Run shellcheck, handle all warnings
midzelis d504440
Add 'strict' mode to bash scripts
midzelis c5f4f70
Move scripts and dynamically link up services.d/cont-init.d
midzelis c5da1c4
Autoupdate functionality
midzelis 83062cd
Use single multi-arch Dockerfile
midzelis 502203f
Allow version-specific builds. Improve build scripts. Readmes.
midzelis 42fdfc9
Log viewer /plex-logs.sh
midzelis 709a6de
Backwards compat. FORCE_UPDATE var
midzelis e2734a5
newlines
midzelis c2fad2c
Do not install on every container start.
midzelis 2cae64a
fix cron schedule
midzelis fcd1c43
bash strict mode prevent hw-transcode script from working properly
midzelis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,12 @@ IFS=$'\n\t' | |
# Assumes this is running on Linux (any distro) using (intel/amd). | ||
|
||
# This bakes the specific binary into the image, you can override these vars on command line | ||
# DOCKERHUB_IMAGE=myorg/mycontainer ./dev/sh bake | ||
# prompt> DOCKERHUB_IMAGE=myorg/mycontainer ./dev/sh bake | ||
VERSION_TO_BUILD=${VERSION_TO_BUILD:-"1.32.4.7195-7c8f9d3b6"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure it should default to a particular version as this script is likely not to be updated often as the server advances in version. |
||
DOCKERHUB_IMAGE=${DOCKERHUB_IMAGE:-"plexinc/pms-docker"} | ||
# launch with KEEP=true to keep the container after starting/running it - manual cleanup required when done | ||
# prompt> KEEP=true ./dev.sh debug arm64v8 autoupdate | ||
KEEP=${KEEP:-} | ||
|
||
setup() { | ||
# Create a multi-arch buildx builder named PlexBuilder (if it doesn't exist) | ||
|
@@ -49,19 +52,33 @@ debug() { | |
platform=$1 | ||
name=$2 | ||
autoupdate=$3 | ||
if [ "$autoupdate" = "autoupdate" ]; then | ||
name=$name:autoupdate | ||
else | ||
name=$name:latest | ||
fi | ||
[ "$autoupdate" = "autoupdate" ] && name=$name:autoupdate || name=$name:latest | ||
if [[ $platform == linux/arm* ]]; then | ||
# shellcheck disable=SC2064 | ||
trap "trap - SIGTERM && docker stop debug-plex" SIGINT SIGTERM EXIT | ||
docker run --rm --name debug-plex --platform "$platform" -e DEBUG=true "$name" & | ||
trap "trap - SIGTERM && docker stop debug-${name/:/_}" SIGINT SIGTERM EXIT | ||
if [ "${KEEP,,}" = "true" ]; then | ||
if docker start "debug-${name/:/_}"; then | ||
docker attach "debug-${name/:/_}" & | ||
else | ||
docker run --name "debug-${name/:/_}" --platform "$platform" -e DEBUG=true "$name" & | ||
fi | ||
else | ||
docker run -rm --name "debug-${name/:/_}" --platform "$platform" -e DEBUG=true "$name" & | ||
fi | ||
sleep 5 | ||
docker exec -it debug-plex bash | ||
docker exec -it "debug-${name/:/_}" bash | ||
else | ||
docker run --rm --name debug-plex --platform "$platform" -e DEBUG=true -it "$name" bash | ||
if [ "${KEEP,,}" = "true" ]; then | ||
if docker start "debug-${name/:/_}"; then | ||
# shellcheck disable=SC2064 | ||
trap "trap - SIGTERM && docker stop debug-${name/:/_}" SIGINT SIGTERM EXIT | ||
docker attach "debug-${name/:/_}" | ||
else | ||
docker run --name "debug-${name/:/_}" --platform "$platform" -e DEBUG=true -it "$name" bash | ||
fi | ||
else | ||
docker run -rm --name "debug-${name/:/_}" --platform "$platform" -e DEBUG=true -it "$name" bash | ||
fi | ||
fi | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prompt>
?