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

Depends-on: github.com/kata-containers/packaging#614

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
  • Loading branch information
GabyCT committed Jul 5, 2019
1 parent e2fedcb commit 9952986
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .ci/versions_checker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/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"

go get -d "${PACKAGING_REPO}" || true

check_changes=$(git diff "${GOPATH}/src/${RUNTIME_REPO}/VERSION")
version_to_check=$(cat "${GOPATH}/src/${RUNTIME_REPO}/VERSION")

if [ ! -z "$check_changes" ]; then
pushd "${GOPATH}/src/${PACKAGING_REPO}"
./release/tag_repos.sh pre-release "${version_to_check}"
popd
fi
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ before_install:

before_script:
- ".ci/static-checks.sh"
- ".ci/versions_checker.sh"

install:
- cd ${TRAVIS_BUILD_DIR}
Expand Down

0 comments on commit 9952986

Please sign in to comment.