Skip to content

Commit

Permalink
ci: Fix versions_checker.sh
Browse files Browse the repository at this point in the history
Version checker does to work today

- Allow to detect stabe branches

Fixes kata-containers#1581

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
  • Loading branch information
jcvenegas committed Oct 23, 2019
1 parent 8ff5bdc commit 0e68662
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .ci/versions_checker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 0e68662

Please sign in to comment.