[CORD-3117]v4

Add support for finding version information in package.json

Change-Id: Iad619e52fd265114deae751c4a6372ccb600df1b
diff --git a/jjb/shell/tagcollisionreject.sh b/jjb/shell/tagcollisionreject.sh
index 81ffaeb..86fe317 100755
--- a/jjb/shell/tagcollisionreject.sh
+++ b/jjb/shell/tagcollisionreject.sh
@@ -35,6 +35,10 @@
   then
     NEW_VERSION=$(head -n1 "VERSION")
     VERSIONFILE="VERSION"
+  elif [ -f "package.json" ]
+  then
+    NEW_VERSION=$(python -c 'import json,sys;obj=json.load(sys.stdin); print obj["version"]' < package.json)
+    VERSIONFILE="package.json"
   else
     echo "ERROR: No versioning file found!"
     exit 1
diff --git a/jjb/shell/versiontag.sh b/jjb/shell/versiontag.sh
index 1ee9246..4287914 100755
--- a/jjb/shell/versiontag.sh
+++ b/jjb/shell/versiontag.sh
@@ -36,6 +36,10 @@
   then
     NEW_VERSION=$(head -n1 "VERSION")
     VERSIONFILE="VERSION"
+  elif [ -f "package.json" ]
+  then
+    NEW_VERSION=$(python -c 'import json,sys;obj=json.load(sys.stdin); print obj["version"]' < package.json)
+    VERSIONFILE="package.json"
   else
     echo "ERROR: No versioning file found!"
     exit 1