blob: 411e508d235b8c6f632a5aa81c8b3e03b8817b0c [file] [log] [blame]
beierlmfb4acf92020-06-25 11:58:13 -04001#!/bin/bash
2#
3# Copyright 2020 ETSI
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
18if [ $# -ne 3 ]; then
19 echo "Usage $0 <repo> <branch> <user>"
20 echo "Example: $0 all v8.0 beierlm"
21 echo "Example: $0 devops v8.0 beierlm"
22 exit 1
23fi
24
25BRANCH="$2"
26USER="$3"
27tag_message="Start of $BRANCH"
28
khelifi81a1a222025-04-28 09:35:51 +010029modules="common devops IM LCM MON N2VC NBI NG-UI NG-SA osmclient RO SOL003 SOL005 tests"
beierlmfb4acf92020-06-25 11:58:13 -040030list=""
31for i in $modules; do
32 if [ "$1" == "$i" -o "$1" == "all" ]; then
33 list="$1"
34 break
35 fi
36done
37
38[ "$1" == "all" ] && list=$modules
39
40if [ -z "$list" ]; then
41 echo "Repo must be one of these: $modules all"
42 exit 1
43fi
44
45for i in $list; do
46 echo "============================================="
47 echo $i
48 if [ ! -d $i ]; then
49 git clone ssh://$USER@osm.etsi.org:29418/osm/$i
50 fi
51 git -C $i checkout master
52 git -C $i pull --rebase
53 git -C $i tag -a "release-$BRANCH-start" -m"$tag_message"
54 git -C $i push origin $TAG --follow-tags
55 git -C $i checkout -b "$BRANCH"
56 git -C $i push -u origin "$BRANCH"
57done
58
59exit 0