Skip to content

Commit

Permalink
ci: Verify and block merge if other projects are not updated
Browse files Browse the repository at this point in the history
This will take the VERSION of all the components in order to
verify that they match among them before merging the runtime.

Fixes kata-containers#1581

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
  • Loading branch information
GabyCT authored and jcvenegas committed Oct 8, 2019
1 parent d758805 commit 197d791
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .ci/versions_checker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# The purpose of this script is to
# run the tag_repos.sh script that is in the
# packaging repository which checks the VERSION
# file from the components in order to verify
# that the VERSION matches between them.
# This ensures that the rest
# of the components are merged before the runtime

set -e

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 HEAD "origin/${KATA_BRANCH}" -- "VERSION")
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 -b "${KATA_BRANCH}" pre-release "${version_to_check}"
popd
fi
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ env:
- target_branch=$TRAVIS_BRANCH

before_install:
- git fetch origin "${TRAVIS_BRANCH}"
- ".ci/versions_checker.sh"
- ".ci/setup.sh"

before_script:
Expand Down

0 comments on commit 197d791

Please sign in to comment.