From 5b226d0d39a0b14d4f6bd3348ae5672a2ed889ad Mon Sep 17 00:00:00 2001 From: Jose Carlos Venegas Munoz Date: Wed, 3 Jul 2019 07:06:08 -0500 Subject: [PATCH] ci: Fix versions_checker.sh Version checker does to work today - Allow to detect stabe branches Fixes #1581 Signed-off-by: Jose Carlos Venegas Munoz --- .ci/versions_checker.sh | 15 ++++++++++++--- .travis.yml | 3 +++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.ci/versions_checker.sh b/.ci/versions_checker.sh index 817f5001f..d722d37b9 100755 --- a/.ci/versions_checker.sh +++ b/.ci/versions_checker.sh @@ -12,20 +12,29 @@ # This ensures that the rest # of the components are merged before the runtime -set -e +set -o errexit +set -o nounset +set -o pipefail +set -o errtrace GOPATH=${GOPATH:-${HOME}/go} PACKAGING_REPO="github.com/kata-containers/packaging" RUNTIME_REPO="github.com/kata-containers/runtime" +KATA_BRANCH=${target_branch:-master} go get -d "${PACKAGING_REPO}" || true -check_changes=$(git diff "${GOPATH}/src/${RUNTIME_REPO}/VERSION") +if ! check_changes=$(git diff --name-only "origin/${KATA_BRANCH}" | grep VERSION); then + echo "No changes in VERSION file - this is not a bump - nothing to check" + exit 0 +fi version_to_check=$(cat "${GOPATH}/src/${RUNTIME_REPO}/VERSION") if [ ! -z "$check_changes" ]; then + echo "Changes detected on VERSION" + echo "Check versions in branch ${KATA_BRANCH}" pushd "${GOPATH}/src/${PACKAGING_REPO}" - ./release/tag_repos.sh pre-release "${version_to_check}" + ./release/tag_repos.sh -b "${KATA_BRANCH}" pre-release "${version_to_check}" popd fi diff --git a/.travis.yml b/.travis.yml index 3b708b538..b6d7660ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,10 @@ env: - target_branch=$TRAVIS_BRANCH before_install: + - git remote set-branches --add origin "${TRAVIS_BRANCH}" + - git fetch - ".ci/setup.sh" + - ".ci/versions_checker.sh" before_script: - ".ci/install_go.sh"