Added script to list the changes for the next point release 10/11610/2
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 31 Jan 2022 23:06:42 +0000 (00:06 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Wed, 9 Feb 2022 08:45:20 +0000 (09:45 +0100)
Change-Id: Id8ba7cc71fb7a5df78242e4f967c2536e6d65219
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
tools/check_changes.sh [new file with mode: 0755]

diff --git a/tools/check_changes.sh b/tools/check_changes.sh
new file mode 100755 (executable)
index 0000000..96f3b90
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/bash
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+
+if [ $# -ne 2 ]; then
+    echo "Usage $0 <branch> <from_tag>"
+    echo "  It will list all the changes in branch <branch> from <from_tag> to the HEAD of the branch"
+    echo "  Example: $0 v11.0 v11.0.0"
+    echo "  Example: $0 v10.0 v10.0.3"
+    exit 1
+fi
+
+BRANCH="$1"
+FROM_REF="$2"
+TO_REF="HEAD"
+
+OSM_CHANGES_FOLDER="$(mktemp -d -q --tmpdir "osmchanges.XXXXXX")"
+echo "Changes in branch ${BRANCH} from ${FROM_REF} to ${TO_REF} stored in ${OSM_CHANGES_FOLDER}"
+
+#trap 'rm -rf "${OSM_CHANGES_FOLDER}"' EXIT
+
+touch "${OSM_CHANGES_FOLDER}/osm_changes-${BRANCH}-from${FROM_REF}-to${TO_REF}.log"
+
+for repo in NBI osmclient IM NG-UI N2VC NG-UI MON POL PLA RO SOL005 common devops tests; do
+    echo ${repo}
+    git -C ${OSM_CHANGES_FOLDER} clone "https://osm.etsi.org/gerrit/osm/${repo}"
+    git -C ${OSM_CHANGES_FOLDER}/$repo checkout ${BRANCH}
+    git -C ${OSM_CHANGES_FOLDER}/$repo log --pretty=format:"%C(yellow)%h %Cblue%ad %Cgreen%>(13,trunc)%an%Cred%d %Creset%s" --date=short ${FROM_REF}..${TO_REF} > "${OSM_CHANGES_FOLDER}/${repo}_changes-${BRANCH}-from${FROM_REF}-to${TO_REF}.log"
+    echo ${repo} >> "${OSM_CHANGES_FOLDER}/osm_changes-${BRANCH}-from${FROM_REF}-to${TO_REF}.log"
+    git -C ${OSM_CHANGES_FOLDER}/$repo log --pretty=format:"%C(yellow)%h %Cblue%ad %Cgreen%>(13,trunc)%an%Cred%d %Creset%s" --date=short ${FROM_REF}..${TO_REF} >> "${OSM_CHANGES_FOLDER}/osm_changes-${BRANCH}-from${FROM_REF}-to${TO_REF}.log"
+    echo >> "${OSM_CHANGES_FOLDER}/osm_changes-${BRANCH}-from${FROM_REF}-to${TO_REF}.log"
+done
+
+echo "Changes in branch ${BRANCH} from ${FROM_REF} to ${TO_REF} stored in ${OSM_CHANGES_FOLDER}"
+echo "All changes can be found in ${OSM_CHANGES_FOLDER}/osm_changes-${BRANCH}-from${FROM_REF}-to${TO_REF}.log"
+