From 5a76e4e5e9027443ef2014d8e1d06e9baa9e50aa Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Mon, 20 Mar 2017 15:36:03 -0700 Subject: [PATCH] load_environment_var: Pickup COREOS_BUILD_ID Change the setting of COREOS_BUILD_ID so that its value, in order of preference, is set to A value set in the environment. A value provided in manifest's version.txt. A fall back value of the current time-date. Signed-off-by: Geoff Levand --- common.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common.sh b/common.sh index a41181dc0d..98a42bc70e 100644 --- a/common.sh +++ b/common.sh @@ -289,9 +289,14 @@ REPO_MANIFESTS_DIR="${REPO_ROOT}/.repo/manifests" # Source COREOS_VERSION_ID from manifest. if [[ -f "${REPO_MANIFESTS_DIR}/version.txt" ]]; then - load_environment_var "${REPO_MANIFESTS_DIR}/version.txt" \ - COREOS_VERSION_ID COREOS_SDK_VERSION # The build id may be provided externally by the build system. + if [[ -n ${COREOS_BUILD_ID} ]]; then + load_environment_var "${REPO_MANIFESTS_DIR}/version.txt" \ + COREOS_VERSION_ID COREOS_SDK_VERSION + else + load_environment_var "${REPO_MANIFESTS_DIR}/version.txt" \ + COREOS_VERSION_ID COREOS_BUILD_ID COREOS_SDK_VERSION + fi : ${COREOS_BUILD_ID:=$(date +%Y-%m-%d-%H%M)} elif [[ -f "${SCRIPT_LOCATION}/version.txt" ]]; then # This only happens in update.zip where we must use the current build id.