summaryrefslogtreecommitdiffstats
path: root/scripts/bump_hc_version.sh
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-01-09 14:11:26 +0100
committerMarek Gradzki <mgradzki@cisco.com>2018-01-09 16:40:45 +0100
commite1050fc83417c986eaeed3b50d5b01eaed0530bd (patch)
tree9cfa39d7007b37815318fd937fba5906f3975cee /scripts/bump_hc_version.sh
parentff903009c7255c6a6f40fd999eaa33b38ec2dc8c (diff)
Add script for honeycomb version bump
The script replaces version string in all files from the Git index. Usage: ./bump_hc_version.sh 1.18.01-SNAPSHOT 1.18.01-RC1 Change-Id: Icee55617dd0cbcdd97c2a1c19f77986f7300e057 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'scripts/bump_hc_version.sh')
-rwxr-xr-xscripts/bump_hc_version.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/bump_hc_version.sh b/scripts/bump_hc_version.sh
new file mode 100755
index 000000000..d1521626c
--- /dev/null
+++ b/scripts/bump_hc_version.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+# Replaces version string in all files from the Git index
+# Usage:
+# ./bump_hc_version.sh 1.2.3-SNAPSHOT 1.2.3-RC1
+
+if [ "$#" -ne 2 ]; then
+ echo "Usage: ./bump_hc_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 -