check binary has correct version when doing release

This commit is contained in:
Tomas Kral
2018-02-14 13:05:29 +01:00
parent fb8023743e
commit 4476007522

View File

@@ -5,6 +5,19 @@ RELEASE_DIR="./dist/release/"
mkdir -p $RELEASE_DIR
# if this is run on travis make sure that binary was build with corrent version
if [[ -n $TRAVIS_TAG ]]; then
echo "Checking if ocdev version was set to the same version as current tag"
# use sed to get only semver part
bin_version=$(${BIN_DIR}/darwin-amd64/ocdev version | sed 's/ .*//g')
if [ "$TRAVIS_TAG" == "v${bin_version}" ]; then
echo "OK: ocdev version output is matching current tag"
else
echo "ERR: TRAVIS_TAG ($TRAVIS_TAG) is not matching 'ocdev version' (v${bin_version})"
exit 1
fi
fi
for arch in `ls -1 $BIN_DIR/`;do
suffix=""
if [[ $arch == windows-* ]]; then