From 108c5db3be54d45b018512fd92e82e93822436f9 Mon Sep 17 00:00:00 2001 From: shubham Date: Thu, 16 Jul 2020 18:49:19 +0530 Subject: [PATCH] revert VERSION file deletion as unit test require it Signed-off-by: shubham --- VERSION | 1 + buildscripts/build.sh | 18 +++--------------- pkg/util/unstructured.go | 2 -- 3 files changed, 4 insertions(+), 17 deletions(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 0000000000..0eed1a29ef --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.12.0 diff --git a/buildscripts/build.sh b/buildscripts/build.sh index 22a73e6c8f..5a7d96835c 100755 --- a/buildscripts/build.sh +++ b/buildscripts/build.sh @@ -26,18 +26,10 @@ fi # Get the version details VERSION_META="$(cat $GOPATH/src/github.com/openebs/maya/BUILDMETA)" -# Determine the current branch -CURRENT_BRANCH="" -if [ -z "${TRAVIS_BRANCH}" ]; -then - CURRENT_BRANCH=$(git branch | grep "\*" | cut -d ' ' -f2) -else - CURRENT_BRANCH="${TRAVIS_BRANCH}" -fi ## Populate the version based on release tag -## If travis tag is set then assign it as VERSION and -## if travis tag is empty then mark version as ci +## If travis tag is set then assign it as VERSION +## take the version from the file if [ -n "$TRAVIS_TAG" ]; then # Trim the `v` from the TRAVIS_TAG if it exists # Example: v1.10.0 maps to 1.10.0 @@ -45,11 +37,7 @@ if [ -n "$TRAVIS_TAG" ]; then # Example: v1.10.0-custom maps to 1.10.0-custom VERSION="${TRAVIS_TAG#v}" else - ## Marking VERSION as current_branch-dev - ## Example: master branch maps to master-dev - ## Example: v1.11.x-ee branch to 1.11.x-ee-dev - ## Example: v1.10.x branch to 1.10.x-dev - VERSION="${CURRENT_BRANCH#v}-dev" + VERSION="$(cat $GOPATH/src/github.com/openebs/maya/VERSION)" fi echo "Building for ${VERSION} VERSION" diff --git a/pkg/util/unstructured.go b/pkg/util/unstructured.go index 1f47f7c0a9..2b88bd519a 100644 --- a/pkg/util/unstructured.go +++ b/pkg/util/unstructured.go @@ -35,8 +35,6 @@ import ( // GetNestedField returns a nested field from the provided map func GetNestedField(obj map[string]interface{}, fields ...string) interface{} { - fmt.Println("obj", obj) - fmt.Println("fields", fields) var val interface{} = obj for _, field := range fields { if _, ok := val.(map[string]interface{}); !ok {