From 0cc6f98002236a25757b5df28b269a86d9ed4710 Mon Sep 17 00:00:00 2001 From: Gabriela Cervantes Date: Wed, 3 Jul 2019 07:06:08 -0500 Subject: [PATCH] ci: Verify and block merge if other projects are not updated This will take the VERSION of all the components in order to verify that they match among them before merging the runtime. Fixes #1581 Signed-off-by: Gabriela Cervantes Signed-off-by: Jose Carlos Venegas Munoz --- .ci/versions_checker.sh | 32 ++++++++++++++++++++++++++++++++ .travis.yml | 1 + 2 files changed, 33 insertions(+) create mode 100755 .ci/versions_checker.sh diff --git a/.ci/versions_checker.sh b/.ci/versions_checker.sh new file mode 100755 index 0000000000..dc67d4e266 --- /dev/null +++ b/.ci/versions_checker.sh @@ -0,0 +1,32 @@ +#!/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 "${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 -b "${KATA_BRANCH}" pre-release "${version_to_check}" + popd +fi diff --git a/.travis.yml b/.travis.yml index d65771fdc6..be6f4d7392 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,7 @@ before_install: before_script: - ".ci/static-checks.sh" + - ".ci/versions_checker.sh" install: - cd ${TRAVIS_BUILD_DIR}