From 5c420c188e3cdb24347c33c1e4110b2b98543f00 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 10 Feb 2014 15:03:16 -0800 Subject: [PATCH] fix(tag_release): increment minor version if major is unchanged --- tag_release | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tag_release b/tag_release index dee2565ad4..d134940c0f 100755 --- a/tag_release +++ b/tag_release @@ -7,9 +7,16 @@ SCRIPT_ROOT=$(dirname $(readlink -f "$0")) . "${SCRIPT_ROOT}/common.sh" || exit 1 -DEFINE_integer build "${TODAYS_VERSION}" \ - "Branch name (aka 'build'), should be days since 2013-7-1" -DEFINE_integer branch 0 "Branch revision, normally 0" +DEFAULT_BUILD=${TODAYS_VERSION} +DEFAULT_BRANCH=0 + +# Increment $BRANCH if we already are on a version from today +if [[ ${DEFAULT_BUILD} -eq ${COREOS_BUILD} ]]; then + DEFAULT_BRANCH=$((COREOS_BRANCH + 1)) +fi + +DEFINE_integer build ${DEFAULT_BUILD} "Branch major version (aka 'build')" +DEFINE_integer branch ${DEFAULT_BRANCH} "Branch revision or minor version" DEFINE_integer patch 0 "Branch patch id, normally 0" DEFINE_string track "dev-channel" "Set the given track to this new branch" DEFINE_string sdk_version "${COREOS_VERSION_ID}" \