From ce32426a3fc01d723a27611633ddc703be2579ef Mon Sep 17 00:00:00 2001 From: Jackson West Date: Sat, 19 Aug 2023 08:34:27 -0500 Subject: [PATCH] fixes raw/cloudstack builds (#2404) --- .../kubernetes-sigs/image-builder/build/build_image.sh | 9 +++++++++ .../kubernetes-sigs/image-builder/buildspecs/ami.yml | 2 +- .../image-builder/buildspecs/cloudstack.yml | 2 +- .../kubernetes-sigs/image-builder/buildspecs/ova.yml | 2 +- .../kubernetes-sigs/image-builder/buildspecs/raw.yml | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/projects/kubernetes-sigs/image-builder/build/build_image.sh b/projects/kubernetes-sigs/image-builder/build/build_image.sh index a71416312f..7fc839beb8 100755 --- a/projects/kubernetes-sigs/image-builder/build/build_image.sh +++ b/projects/kubernetes-sigs/image-builder/build/build_image.sh @@ -34,6 +34,15 @@ elif [[ "$image_os" == "redhat" ]]; then image_os_version_arg="--os-version $image_os_version" fi +if [ ! -f "${HOME}/image-builder" ]; then + ARCH="arm64" + if [[ "$(uname -m)" == "x86_64" ]]; then + ARCH="amd64" + fi + + cp "$MAKE_ROOT/../../aws/image-builder/_output/bin/image-builder/linux-$ARCH/image-builder" "${HOME}" +fi + image_builder_config_file="${HOME}/image_builder_config_file" redhat_config_file="${HOME}/redhat_config_file" if [[ $image_os == "redhat" ]]; then diff --git a/projects/kubernetes-sigs/image-builder/buildspecs/ami.yml b/projects/kubernetes-sigs/image-builder/buildspecs/ami.yml index b149c50015..1a4544c431 100644 --- a/projects/kubernetes-sigs/image-builder/buildspecs/ami.yml +++ b/projects/kubernetes-sigs/image-builder/buildspecs/ami.yml @@ -16,5 +16,5 @@ phases: build: commands: - - make binaries -C $CLI_FOLDER && cp $CLI_FOLDER/_output/bin/image-builder/linux-$(go env GOARCH)/image-builder $HOME + - make binaries -C $CLI_FOLDER - if make check-for-supported-release-branch -C $PROJECT_PATH; then make release IMAGE_OS=$IMAGE_OS IMAGE_FORMAT=ami RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH; fi diff --git a/projects/kubernetes-sigs/image-builder/buildspecs/cloudstack.yml b/projects/kubernetes-sigs/image-builder/buildspecs/cloudstack.yml index 287741964b..aaf16851c9 100644 --- a/projects/kubernetes-sigs/image-builder/buildspecs/cloudstack.yml +++ b/projects/kubernetes-sigs/image-builder/buildspecs/cloudstack.yml @@ -12,5 +12,5 @@ phases: build: commands: - - make binaries -C $CLI_FOLDER && cp $CLI_FOLDER/_output/bin/image-builder/linux-$(go env GOARCH)/image-builder $HOME + - make binaries -C $CLI_FOLDER - if make check-for-supported-release-branch -C $PROJECT_PATH; then make release IMAGE_OS=$IMAGE_OS IMAGE_FORMAT=cloudstack RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH; fi diff --git a/projects/kubernetes-sigs/image-builder/buildspecs/ova.yml b/projects/kubernetes-sigs/image-builder/buildspecs/ova.yml index 2b94ebc074..25b7fb641a 100644 --- a/projects/kubernetes-sigs/image-builder/buildspecs/ova.yml +++ b/projects/kubernetes-sigs/image-builder/buildspecs/ova.yml @@ -22,5 +22,5 @@ phases: build: commands: - - make binaries -C $CLI_FOLDER && cp $CLI_FOLDER/_output/bin/image-builder/linux-$(go env GOARCH)/image-builder $HOME + - make binaries -C $CLI_FOLDER - if make check-for-supported-release-branch -C $PROJECT_PATH; then make release IMAGE_OS=$IMAGE_OS IMAGE_FORMAT=ova RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH; fi diff --git a/projects/kubernetes-sigs/image-builder/buildspecs/raw.yml b/projects/kubernetes-sigs/image-builder/buildspecs/raw.yml index c17a1f13cf..0b63dda2de 100644 --- a/projects/kubernetes-sigs/image-builder/buildspecs/raw.yml +++ b/projects/kubernetes-sigs/image-builder/buildspecs/raw.yml @@ -12,5 +12,5 @@ phases: build: commands: - - make binaries -C $CLI_FOLDER && cp $CLI_FOLDER/_output/bin/image-builder/linux-$(go env GOARCH)/image-builder $HOME + - make binaries -C $CLI_FOLDER - if make check-for-supported-release-branch -C $PROJECT_PATH; then make release IMAGE_OS=$IMAGE_OS IMAGE_FORMAT=raw RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH; fi