From 351a6a7c73a2a8b65d062495e61017ddbf4c6144 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 3 Mar 2024 21:11:34 -0500 Subject: Move pushes earlier --- build.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/build.py b/build.py index 1bb144d..35c28ac 100755 --- a/build.py +++ b/build.py @@ -344,6 +344,21 @@ def build_docker(jellyfin_version, build_type, _build_arch, _build_version): log("") + # Log in to docker hub + os.system("docker login 2>&1") + + # Push the images to DockerHub + for image in images: + log(f">>> Pushing image {image} to DockerHub") + log(f">>>> docker push {image} 2>&1") + os.system(f"docker push {image} 2>&1") + + # Push the images to GHCR + for image in ghcr_images: + log(f">>> Pushing image {image} to GHCR") + log(f">>>> docker push {image} 2>&1") + os.system(f"docker push {image} 2>&1") + # Build the manifests log(">> Building Docker manifests...") manifests = list() @@ -400,24 +415,13 @@ def build_docker(jellyfin_version, build_type, _build_arch, _build_version): ) manifests.append(f"{configurations['docker']['imagename']}:unstable") - # Log in to docker hub - os.system("docker login 2>&1") - # Push the images and manifests to DockerHub (we are already logged in from GH Actions) - for image in images: - log(f">>> Pushing image {image} to DockerHub") - log(f">>>> docker push {image} 2>&1") - os.system(f"docker push {image} 2>&1") for manifest in manifests: log(f">>> Pushing manifest {manifest} to DockerHub") log(f">>>> docker manifest push --purge docker.io/{manifest} 2>&1") os.system(f"docker manifest push --purge docker.io/{manifest} 2>&1") # Push the images and manifests to GHCR (we are already logged in from GH Actions) - for image in images: - log(f">>> Pushing image {image} to GHCR") - log(f">>>> docker push ghcr.io/{image} 2>&1") - os.system(f"docker push ghcr.io/{image} 2>&1") for manifest in manifests: log(f">>> Pushing manifest {manifest} to GHCR") log(f">>>> docker manifest push --purge ghcr.io/{manifest} 2>&1") -- cgit