Skip to content

Commit

Permalink
Add IMAGE_OS_VERSION to image-builder buildspecs (#3052)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay-krishna authored Apr 2, 2024
1 parent 955d2a1 commit c498167
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 4 deletions.
7 changes: 6 additions & 1 deletion build/lib/generate_staging_buildspec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,14 @@ for project in "${PROJECTS[@]}"; do
for val2 in "${ARR_2[@]}"; do
BUILDSPEC_NAME=$(basename $buildspec .yml)
IDENTIFIER=${org//-/_}_${repo//-/_}_${val1//-/_}_${val2//-/_}_${BUILDSPEC_NAME//-/_}
# TODO: revisit this to make it more dynamic if other projects need it in the future
EXTRA_VARS=""
if [[ "$IDENTIFIER" =~ "kubernetes_sigs_image_builder_bottlerocket" ]]; then
EXTRA_VARS+=",\"IMAGE_OS_VERSION\":\"1\""
fi
ALL_PROJECT_IDS+="\"$IDENTIFIER\","
yq eval -i -P \
".batch.build-graph += [{\"identifier\":\"$IDENTIFIER\",$buildspec_field$DEPEND_ON\"env\":{$ARCH_TYPE\"variables\":{\"PROJECT_PATH\": \"projects/$org/$repo\"$CLONE_URL,\"${KEYS[0]}\":\"$val1\",\"${KEYS[1]}\":\"$val2\"}}}]" \
".batch.build-graph += [{\"identifier\":\"$IDENTIFIER\",$buildspec_field$DEPEND_ON\"env\":{$ARCH_TYPE\"variables\":{\"PROJECT_PATH\": \"projects/$org/$repo\"$CLONE_URL,\"${KEYS[0]}\":\"$val1\",\"${KEYS[1]}\":\"$val2\"$EXTRA_VARS}}}]" \
$STAGING_BUILDSPEC_FILE
done
done
Expand Down
2 changes: 1 addition & 1 deletion projects/kubernetes-sigs/image-builder/buildspecs/ami.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ phases:

build:
commands:
- if make check-for-supported-release-branch IMAGE_OS=$IMAGE_OS IMAGE_FORMAT=ami RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH && make check-for-release-branch-skip -C $PROJECT_PATH; then make binaries -C $CLI_FOLDER && make release IMAGE_OS=$IMAGE_OS IMAGE_FORMAT=ami RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH; fi
- if make check-for-supported-release-branch IMAGE_OS=$IMAGE_OS IMAGE_FORMAT=ami RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH && make check-for-release-branch-skip -C $PROJECT_PATH; then make binaries -C $CLI_FOLDER && make release IMAGE_OS=$IMAGE_OS IMAGE_OS_VERSION=$IMAGE_OS_VERSION IMAGE_FORMAT=ami RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH; fi
2 changes: 1 addition & 1 deletion projects/kubernetes-sigs/image-builder/buildspecs/ova.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ phases:

build:
commands:
- if make check-for-supported-release-branch IMAGE_OS=$IMAGE_OS IMAGE_FORMAT=ova RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH && make check-for-release-branch-skip -C $PROJECT_PATH; then make binaries -C $CLI_FOLDER && make release IMAGE_OS=$IMAGE_OS IMAGE_FORMAT=ova RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH; fi
- if make check-for-supported-release-branch IMAGE_OS=$IMAGE_OS IMAGE_FORMAT=ova RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH && make check-for-release-branch-skip -C $PROJECT_PATH; then make binaries -C $CLI_FOLDER && make release IMAGE_OS=$IMAGE_OS IMAGE_OS_VERSION=$IMAGE_OS_VERSION IMAGE_FORMAT=ova RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH; fi
2 changes: 1 addition & 1 deletion projects/kubernetes-sigs/image-builder/buildspecs/raw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ phases:

build:
commands:
- if make check-for-supported-release-branch IMAGE_OS=$IMAGE_OS IMAGE_FORMAT=raw RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH && make check-for-release-branch-skip -C $PROJECT_PATH; then make binaries -C $CLI_FOLDER && make release IMAGE_OS=$IMAGE_OS IMAGE_FORMAT=raw RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH; fi
- if make check-for-supported-release-branch IMAGE_OS=$IMAGE_OS IMAGE_FORMAT=raw RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH && make check-for-release-branch-skip -C $PROJECT_PATH; then make binaries -C $CLI_FOLDER && make release IMAGE_OS=$IMAGE_OS IMAGE_OS_VERSION=$IMAGE_OS_VERSION IMAGE_FORMAT=raw RELEASE_BRANCH=$RELEASE_BRANCH -C $PROJECT_PATH; fi
15 changes: 15 additions & 0 deletions release/staging-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-25
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_26_ova
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ova.yml
env:
Expand All @@ -410,6 +411,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-26
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_27_ova
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ova.yml
env:
Expand All @@ -420,6 +422,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-27
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_28_ova
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ova.yml
env:
Expand All @@ -430,6 +433,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-28
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_29_ova
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ova.yml
env:
Expand All @@ -440,6 +444,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-29
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_25_raw
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/raw.yml
env:
Expand All @@ -450,6 +455,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-25
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_26_raw
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/raw.yml
env:
Expand All @@ -460,6 +466,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-26
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_27_raw
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/raw.yml
env:
Expand All @@ -470,6 +477,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-27
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_28_raw
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/raw.yml
env:
Expand All @@ -480,6 +488,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-28
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_29_raw
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/raw.yml
env:
Expand All @@ -490,6 +499,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-29
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_25_ami
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ami.yml
env:
Expand All @@ -500,6 +510,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-25
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_26_ami
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ami.yml
env:
Expand All @@ -510,6 +521,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-26
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_27_ami
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ami.yml
env:
Expand All @@ -520,6 +532,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-27
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_28_ami
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ami.yml
env:
Expand All @@ -530,6 +543,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-28
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_29_ami
buildspec: projects/kubernetes-sigs/image-builder/buildspecs/ami.yml
env:
Expand All @@ -540,6 +554,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-29
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_kind
buildspec: buildspecs/binaries.yml
env:
Expand Down
5 changes: 5 additions & 0 deletions tools/version-tracker/buildspecs/upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-25
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_26_upgrade_buildspec
env:
type: ARM_CONTAINER
Expand All @@ -242,6 +243,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-26
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_27_upgrade_buildspec
env:
type: ARM_CONTAINER
Expand All @@ -251,6 +253,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-27
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_28_upgrade_buildspec
env:
type: ARM_CONTAINER
Expand All @@ -260,6 +263,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-28
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_image_builder_bottlerocket_1_29_upgrade_buildspec
env:
type: ARM_CONTAINER
Expand All @@ -269,6 +273,7 @@ batch:
CLONE_URL: https://git-codecommit.us-west-2.amazonaws.com/v1/repos/kubernetes-sigs.image-builder
IMAGE_OS: bottlerocket
RELEASE_BRANCH: 1-29
IMAGE_OS_VERSION: "1"
- identifier: kubernetes_sigs_kind
env:
type: ARM_CONTAINER
Expand Down

0 comments on commit c498167

Please sign in to comment.