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