systest makefile fixes
[osm/devops.git] / tools / newtag.sh
1 #!/bin/bash
2 if [ $# -ne 2 ]; then
3 echo "Usage $0 <repo> <tag>"
4 exit 1
5 fi
6
7 TAG="$2"
8 tag_header="OSM Release THREE:" tag_message="$tag_header version $TAG"
9
10 modules="devops openvim RO SO UI IM osmclient"
11 list=""
12 for i in $modules; do
13 if [ "$1" == "$i" -o "$1" == "all" ]; then
14 list="$1"
15 break
16 fi
17 done
18
19 [ "$1" == "all" ] && list=$modules
20
21 if [ -z "$list" ]; then
22 echo "Repo must be one of these: $modules all"
23 exit 1
24 fi
25
26 for i in $list; do
27 echo $i
28 if [ ! -d $i ]; then
29 git clone https://osm.etsi.org/gerrit/osm/$i
30 fi
31 git -C $i checkout master
32 git -C $i pull --rebase
33 git -C $i tag -a $TAG -m"$tag_message"
34 git -C $i push origin $TAG --follow-tags
35 sleep 2
36 done
37
38 exit 0