From 09ce3d9d9be7642b4abebdd93e149e89a3655c59 Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Sun, 25 May 2025 12:54:02 -0600 Subject: [PATCH] i think mvp --- build.sh | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index bd364b2..daf39cd 100644 --- a/build.sh +++ b/build.sh @@ -4,7 +4,27 @@ main() { set -eo pipefail cd_work_d - ensure_ytdlp2STRM_git + + ytdlp2STRM_d=./ytdlp2STRM + ensure_ytdlp2STRM_git "$ytdlp2STRM_d" + + head_ts="$(cd "$ytdlp2STRM_d"; git log -n 1 --format=%as)" + echo head_ts=$head_ts + + yt_dlp_latest="$(pip3 index versions yt-dlp | grep LATEST | awk '{print $NF}')" + echo yt_dlp_latest=$yt_dlp_latest + + img=registry-app.inhome.blapointe.com:5001/bel/ytdlp2strm + tag=${head_ts}-${yt_dlp_latest} + if docker pull $img:$tag; then + exit 0 + fi + + cd "$ytdlp2STRM_d" + docker build -t "$img:$tag" . + docker tag "$img:$tag" "$img:latest" + $DEBUG docker push "$img:$tag" + $DEBUG docker push "$img:latest" } cd_work_d() { @@ -19,9 +39,10 @@ cd_work_d() { } ensure_ytdlp2STRM_git() { - if [ ! -d ytdlp2STRM ]; then + if [ ! -d "$1" ]; then git clone --depth=1 \ - https://github.com/fe80Grau/ytdlp2STRM.git + https://github.com/fe80Grau/ytdlp2STRM.git \ + "$1" fi }