summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-07-27 08:31:04 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-07-27 06:43:15 +0000
commit70f83444a90680aa38c51dee4b264de0ef9fd879 (patch)
tree3d85207606349867cfa6874d2e5268d4de90ec50
parent5136cea1205b2b334203c7216b4ef63adee7424e (diff)
Add script for bumping hc2vpp version
The script simply replaces version string in all files from GIT index. TODO(HC2VPP-369): does not cover updating package versions and release notes. Change-Id: Iff4d84ced69873bd8d7e7d58714750d8f2b355e6 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
-rwxr-xr-xscripts/bump_version.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/bump_version.sh b/scripts/bump_version.sh
new file mode 100755
index 000000000..b8a2add65
--- /dev/null
+++ b/scripts/bump_version.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# Replaces version string in all files from the Git index
+# Usage:
+# ./bump_version.sh 1.2.3-SNAPSHOT 1.2.3-RC1
+
+if [ "$#" -ne 2 ]; then
+ echo "Usage: ./bump_version.sh OLD_VERSION NEW_VERSION"
+ exit 1
+fi
+
+OLD_VERSION=$1
+NEW_VERSION=$2
+BUMP_SCRIPT_FILENAME=$(basename "$0")
+GIT_ROOT=$(git rev-parse --show-toplevel)
+
+cd $GIT_ROOT
+
+for i in $(git ls-files); do
+ sed -i "s/${OLD_VERSION}/${NEW_VERSION}/g" $i
+done
+
+cd -