Skip to content

Commit

Permalink
Fix bad import and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaboniface committed Mar 4, 2024
1 parent 5d15517 commit 5fcad3f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def build_manifests(server, images):
# Build the manifests
log(f">> Building Docker manifests for {server}...")
manifests = list()

if version_suffix:
log(">>> Building dated version manifest...")
log(
Expand All @@ -361,7 +361,7 @@ def build_manifests(server, images):
manifests.append(
f"{configurations['docker']['imagename']}:{jellyfin_version}.{date}"
)

log(">>> Building version manifest...")
log(
f">>>> docker manifest create {configurations['docker']['imagename']}:{jellyfin_version} {' '.join(images)}"
Expand All @@ -370,7 +370,7 @@ def build_manifests(server, images):
f"docker manifest create {server}/{configurations['docker']['imagename']}:{jellyfin_version} {' '.join(images)}"
)
manifests.append(f"{configurations['docker']['imagename']}:{jellyfin_version}")

if is_latest:
log(">>> Building latest manifest...")
log(
Expand All @@ -393,15 +393,17 @@ def build_manifests(server, images):
return manifests

# Log in to DockerHub
os.system(f"docker login -u {os.getenv('DOCKER_USERNAME')} -p {os.getenv('DOCKER_TOKEN')} docker.io 2>&1")
os.system(
f"docker login -u {getenv('DOCKER_USERNAME')} -p {getenv('DOCKER_TOKEN')} docker.io 2>&1"
)

# Push the images to DockerHub
for image in images_hub:
log(f">>> Pushing image {image} to DockerHub")
log(f">>>> docker push {image} 2>&1")
os.system(f"docker push {image} 2>&1")

manifests_hub = build_manifests('docker.io', images_hub)
manifests_hub = build_manifests("docker.io", images_hub)

# Push the images and manifests to DockerHub
for manifest in manifests_hub:
Expand All @@ -413,15 +415,17 @@ def build_manifests(server, images):
os.system("docker logout")

# Log in to GHCR
os.system(f"docker login -u {os.getenv('GHCR_USERNAME')} -p {os.getenv('GHCR_TOKEN')} ghcr.io 2>&1")
os.system(
f"docker login -u {getenv('GHCR_USERNAME')} -p {getenv('GHCR_TOKEN')} ghcr.io 2>&1"
)

# Push the images to GHCR
for image in images_ghcr:
log(f">>> Pushing image {image} to GHCR")
log(f">>>> docker push {image} 2>&1")
os.system(f"docker push {image} 2>&1")

manifests_ghcr = build_manifests('ghcr.io', images_ghcr)
manifests_ghcr = build_manifests("ghcr.io", images_ghcr)

# Push the images and manifests to GHCR
for manifest in manifests_ghcr:
Expand Down

0 comments on commit 5fcad3f

Please sign in to comment.