Skip to content
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

fix: Resolve the unsupported build system issue with the windows build images batch scripts #926

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,37 @@
@echo off
IF "%3"=="" GOTO DEFAULT_CONTAINER_RUNTIME
SET CONTAINER_RUNTIME=%3%
GOTO :REGISTRY
GOTO REGISTRY

:DEFAULT_CONTAINER_RUNTIME
SET CONTAINER_RUNTIME=docker
GOTO REGISTRY

:REGISTRY
IF "%2"=="" GOTO DEFAULT_REGISTRY
IF "%1"=="" GOTO DEFAULT_REGISTRY
SET REGISTRY_URL=%1
SET REGISTRY_NAMESPACE=%2
GOTO :MAIN
GOTO DOCKER_CONTAINER_RUNTIME

:DEFAULT_REGISTRY
SET REGISTRY_URL={{ .RegistryURL }}
SET REGISTRY_NAMESPACE={{ .RegistryNamespace }}
GOTO DOCKER_CONTAINER_RUNTIME

:DOCKER_CONTAINER_RUNTIME
IF NOT "%CONTAINER_RUNTIME%" == "docker" GOTO PODMAN_CONTAINER_RUNTIME
GOTO MAIN

:PODMAN_CONTAINER_RUNTIME
IF NOT "%CONTAINER_RUNTIME%" == "podman" GOTO UNSUPPORTED_BUILD_SYSTEM
GOTO MAIN

:UNSUPPORTED_BUILD_SYSTEM
echo 'Unsupported build system passed as an argument for pushing the images.'
GOTO SKIP

:MAIN
IF NOT %CONTAINER_RUNTIME% == "docker" IF NOT %CONTAINER_RUNTIME% == "podman" GOTO UNSUPPORTED_BUILD_SYSTEM
:: Uncomment the below line if you want to enable login before pushing
:: %CONTAINER_RUNTIME% login %REGISTRY_URL%
{{- range $image := .Images }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
:: 2) buildandpush_multiarchimages.bat index.docker.io your_registry_namespace
:: 3) buildandpush_multiarchimages.bat quay.io your_quay_username linux/amd64,linux/arm64,linux/s390x

@echo off
for /F "delims=" %%i in ("%cd%") do set basename="%%~ni"

if not %basename% == "scripts" (
Expand All @@ -28,24 +29,25 @@ if not %basename% == "scripts" (
REM go to the parent directory so that all the relative paths will be correct
cd {{ .RelParentOfSourceDir }}

@echo off
IF "%3"=="" GOTO DEFAULT_PLATFORMS
SET PLATFORMS=%3%
GOTO :REGISTRY
GOTO REGISTRY

:DEFAULT_PLATFORMS
SET PLATFORMS=linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
GOTO REGISTRY

:REGISTRY
IF "%2"=="" GOTO DEFAULT_REGISTRY
IF "%1"=="" GOTO DEFAULT_REGISTRY
SET REGISTRY_URL=%1
SET REGISTRY_NAMESPACE=%2
GOTO :MAIN
GOTO MAIN

:DEFAULT_REGISTRY
SET REGISTRY_URL={{ .RegistryURL }}
SET REGISTRY_NAMESPACE={{ .RegistryNamespace }}
GOTO MAIN

:MAIN
:: Uncomment the below line if you want to enable login before pushing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,35 @@
:: 1) buildimages.bat
:: 2) buildimages.bat podman

@echo off
for /F "delims=" %%i in ("%cd%") do set basename="%%~ni"

if not %basename% == "scripts" (
echo "please run this script from the 'scripts' directory"
exit 1
)

@echo off
IF "%1"=="" GOTO DEFAULT_CONTAINER_RUNTIME
SET CONTAINER_RUNTIME=%1%
GOTO MAIN
GOTO DOCKER_CONTAINER_RUNTIME

:DEFAULT_CONTAINER_RUNTIME
SET CONTAINER_RUNTIME=docker
GOTO MAIN
GOTO MAIN

:DOCKER_CONTAINER_RUNTIME
IF NOT "%CONTAINER_RUNTIME%" == "docker" GOTO PODMAN_CONTAINER_RUNTIME
GOTO MAIN

:PODMAN_CONTAINER_RUNTIME
IF NOT "%CONTAINER_RUNTIME%" == "podman" GOTO UNSUPPORTED_BUILD_SYSTEM
GOTO MAIN

:UNSUPPORTED_BUILD_SYSTEM
echo 'Unsupported build system passed as an argument for pushing the images.'
GOTO SKIP

:MAIN
IF NOT %CONTAINER_RUNTIME% == "docker" IF NOT %CONTAINER_RUNTIME% == "podman" GOTO UNSUPPORTED_BUILD_SYSTEM
REM go to the parent directory so that all the relative paths will be correct
cd {{ .RelParentOfSourceDir }}

Expand Down