From f598fb51646dbaf97e984a70d293bc13f62417bc Mon Sep 17 00:00:00 2001 From: Jaroslav Fedor Date: Thu, 17 Oct 2024 12:54:40 +0200 Subject: [PATCH] Fix condition for release pipe --- cmake/docker-utils.cmake | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/cmake/docker-utils.cmake b/cmake/docker-utils.cmake index 487fa111..6c35504d 100644 --- a/cmake/docker-utils.cmake +++ b/cmake/docker-utils.cmake @@ -148,7 +148,7 @@ function(build_custom_docker_image IMAGE_NAME) endforeach() # Get the value of the environment variable ENABLE_ARM64_BUILD - if (DEFINED ENV{ENABLE_ARM64_BUILD} AND ENV{ENABLE_ARM64_BUILD}) + if (DEFINED ENV{ENABLE_ARM64_BUILD} AND "$ENV{ENABLE_ARM64_BUILD}" STREQUAL "TRUE") set(ENABLE_ARM64_BUILD TRUE) else() set(ENABLE_ARM64_BUILD FALSE) @@ -164,18 +164,19 @@ function(build_custom_docker_image IMAGE_NAME) COMMAND docker buildx build --platform linux/amd64 -t "${IMAGE_NAME}" ${DOCKER_ARGS} . ) + if (ENABLE_ARM64_BUILD) + add_custom_command( + TARGET + "${IMAGE_NAME}-docker" + WORKING_DIRECTORY + "${out_path}" + COMMAND + docker buildx build --platform linux/arm64 -t "${IMAGE_NAME}-arm64" ${DOCKER_ARGS} . + ) + endif() endif() - if (RUN_DOCKER_COMMANDS AND ENABLE_ARM64_BUILD) - add_custom_command( - TARGET - "${IMAGE_NAME}-docker" - WORKING_DIRECTORY - "${out_path}" - COMMAND - docker buildx build --platform linux/arm64 -t "${IMAGE_NAME}-arm64" ${DOCKER_ARGS} . - ) - endif() + ########################### # push to docker registry #