Update list of modules for tag creation and tag deletion
[osm/devops.git] / tools / deletetag.sh
1 #!/bin/bash
2 #
3 # Copyright ETSI Contributors and Others
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 if [ $# -ne 2 ]; then
18 echo "Usage $0 <repo> <tag>"
19 echo "Example: $0 all v11.0.1"
20 echo "Example: $0 devops v11.0.3"
21 exit 1
22 fi
23
24 TAG="$2"
25 tag_header="OSM Release TWO:"
26 tag_message="$tag_header version $TAG"
27
28 modules="common devops IM LCM MON N2VC NBI NG-UI osmclient RO PLA POL SOL003 SOL005 tests"
29 list=""
30 for i in $modules; do
31 if [ "$1" == "$i" -o "$1" == "all" ]; then
32 list="$1"
33 break
34 fi
35 done
36
37 [ "$1" == "all" ] && list=$modules
38
39 if [ -z "$list" ]; then
40 echo "Repo must be one of these: $modules all"
41 exit 1
42 fi
43
44 for i in $list; do
45 echo $i
46 if [ ! -d $i ]; then
47 git clone ssh://$USER@osm.etsi.org:29418/osm/$i
48 fi
49 git -C $i fetch
50 echo "Deleting tag $TAG in repo $i"
51 git -C $i tag -d $TAG
52 git -C $i push origin :refs/tags/$TAG
53 sleep 2
54 done
55
56 exit 0
57