Skip to content

Commit

Permalink
Set eks-a version globally in the Makefile (#7517)
Browse files Browse the repository at this point in the history
This guarantees the right version is set at the beginning, no matter the
target and the binary to be built. It avoids situations where different
binaries generated from the same make command are built with different
versions.
  • Loading branch information
g-gaston authored Feb 8, 2024
1 parent 35e5af8 commit 9876761
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ BRANCH_NAME?=main
# https://github.com/aws/eks-anywhere/blob/main/docs/developer/manifests.md#locally-building-the-cli
ifneq ($(PULL_BASE_REF),) # PULL_BASE_REF originates from prow
BRANCH_NAME=$(PULL_BASE_REF)
DEV_GIT_VERSION ?= $(shell source ./scripts/eksa_version.sh && eksa-version::get_next_eksa_version_for_ancestor $(PULL_BASE_REF))-dev+latest
else
DEV_GIT_VERSION ?= $(shell source ./scripts/eksa_version.sh && eksa-version::get_next_eksa_version)-dev+latest
endif
ifeq (,$(findstring $(BRANCH_NAME),main))
## use the branch-specific bundle manifest if the branch is not 'main'
Expand All @@ -50,6 +47,22 @@ RELEASE_MANIFEST_URL?=https://dev-release-assets.eks-anywhere.model-rocket.aws.d
LATEST=latest
endif

# DEV_GIT_VERSION should be something like v0.19.0-dev+latest, depending on the base branch
# and if this is a local build or a CI build.
# https://github.com/aws/eks-anywhere/blob/main/docs/developer/manifests.md#locally-building-the-cli
ifneq ($(PULL_BASE_REF),)
# PULL_BASE_REF originates from prow
# If prow presubmit, ping to the latest available version
DEV_GIT_VERSION ?= $(shell source ./scripts/eksa_version.sh && eksa-version::latest_release_verison_in_manifest "$(RELEASE_MANIFEST_URL)")
else ifeq ($(CODEBUILD_CI),true)
# If codebuild e2e tests, ping to the latest available version
DEV_GIT_VERSION ?= $(shell source ./scripts/eksa_version.sh && eksa-version::latest_release_verison_in_manifest "$(RELEASE_MANIFEST_URL)")
else
# Else, this is a local buid, so use "dev+latest" to always select the latest
# version in the manifest in runtime.
DEV_GIT_VERSION ?= $(shell source ./scripts/eksa_version.sh && eksa-version::get_next_eksa_version)-dev+latest
endif

CUSTOM_GIT_VERSION:=v0.0.0-custom

AWS_ACCOUNT_ID?=$(shell aws sts get-caller-identity --query Account --output text)
Expand Down Expand Up @@ -648,7 +661,7 @@ build-eks-a-for-e2e:
scripts/get_bundle.sh; \
else \
make eks-a-cross-platform; \
make eks-a-for-dev-e2e; \
make eks-a; \
fi \
else \
make eksa-components-override; \
Expand Down

0 comments on commit 9876761

Please sign in to comment.