Skip to content

Commit

Permalink
Add ability to disable Docker pushes
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaboniface committed Mar 4, 2024
1 parent cc225d5 commit 4e81d71
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def log(message):
exit(1)


def build_package_deb(jellyfin_version, build_type, build_arch, build_version):
def build_package_deb(jellyfin_version, build_type, build_arch, build_version, no_push=False):
"""
Build a .deb package (Debian or Ubuntu) within a Docker container that matches the requested distribution version
"""
Expand Down Expand Up @@ -111,7 +111,7 @@ def build_package_deb(jellyfin_version, build_type, build_arch, build_version):
)


def build_package_rpm(jellyfin_version, build_type, build_arch, build_version):
def build_package_rpm(jellyfin_version, build_type, build_arch, build_version, no_push=False):
"""
Build a .rpm package (Fedora or CentOS) within a Docker container that matches the requested distribution version
"""
Expand All @@ -121,7 +121,7 @@ def build_package_rpm(jellyfin_version, build_type, build_arch, build_version):
pass


def build_linux(jellyfin_version, build_type, build_arch, _build_version):
def build_linux(jellyfin_version, build_type, build_arch, _build_version, no_push=False):
"""
Build a portable Linux archive
"""
Expand Down Expand Up @@ -163,7 +163,7 @@ def build_linux(jellyfin_version, build_type, build_arch, _build_version):
)


def build_windows(jellyfin_version, build_type, _build_arch, _build_version):
def build_windows(jellyfin_version, build_type, _build_arch, _build_version, no_push=False):
"""
Build a portable Windows archive
"""
Expand Down Expand Up @@ -205,7 +205,7 @@ def build_windows(jellyfin_version, build_type, _build_arch, _build_version):
)


def build_macos(jellyfin_version, build_type, build_arch, _build_version):
def build_macos(jellyfin_version, build_type, build_arch, _build_version, no_push=False):
"""
Build a portable MacOS archive
"""
Expand Down Expand Up @@ -247,7 +247,7 @@ def build_macos(jellyfin_version, build_type, build_arch, _build_version):
)


def build_portable(jellyfin_version, build_type, _build_arch, _build_version):
def build_portable(jellyfin_version, build_type, _build_arch, _build_version, no_push=False):
"""
Build a portable .NET archive
"""
Expand Down Expand Up @@ -276,7 +276,7 @@ def build_portable(jellyfin_version, build_type, _build_arch, _build_version):
)


def build_docker(jellyfin_version, build_type, _build_arch, _build_version):
def build_docker(jellyfin_version, build_type, _build_arch, _build_version, no_push=False):
"""
Build Docker images for all architectures and combining manifests
"""
Expand Down Expand Up @@ -345,6 +345,9 @@ def build_docker(jellyfin_version, build_type, _build_arch, _build_version):

log("")

if no_push:
return

def build_manifests(server, images):
# Build the manifests
log(f">> Building Docker manifests for {server}...")
Expand Down Expand Up @@ -510,7 +513,12 @@ def usage():
jellyfin_version = datetime.now().strftime("%Y%m%d%H")
log(f"NOTE: Autocorrecting 'master' version to {jellyfin_version}")

if "--no-push" in sys.argv:
no_push = True
else:
no_push = False

# Launch the builder function
function_definitions[configurations[build_type]["build_function"]](
jellyfin_version, build_type, build_arch, build_version
jellyfin_version, build_type, build_arch, build_version, no_push=no_push
)

0 comments on commit 4e81d71

Please sign in to comment.