blob: 3221fe1b4e257ff851e0495eae2c2bd7687f952c [file] [log] [blame]
micky38788ad2212021-05-03 12:47:47 +02001#!/bin/bash
2#
3# Copyright (C) 2016 OmniROM Project
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#
17echo -e "Enter the username"
18read username
19echo -e "Enter the topic branch name (only needed for gerrit)"
20read topicname
21echo -e "Do you want to push on "github" or "gerrit" ?"
22read admin
23
24OPERATION="${admin}"
25
26url="gerrit.omnirom.org"
27port="29418"
28branch="android-11"
29
30cd ../../../
31
32while read path;
33 do
34
35 project=`echo android_${path} | sed -e 's/\//\_/g'`;
36 if [ "${path}" == "build" ] ; then
37 path="build/make";
38 fi
39
40 echo ""
41 echo "====================================================================="
42 echo " PROJECT: ${project} -> [ ${path}/ ]"
43 echo ""
44
45 cd $path;
46
47 echo " Pushing..."
48
49 if [[ "${OPERATION}" == "github" ]]; then
50 echo " git push --no-thin ssh://${username}@${url}:${port}/${project} HEAD:refs/heads/${branch}"
51 git push --no-thin ssh://${username}@${url}:${port}/${project} HEAD:refs/heads/${branch}
52 elif [[ "${OPERATION}" == "gerrit" ]]; then
53 echo " git push --no-thin ssh://${username}@${url}:${port}/${project} HEAD:refs/for/${branch}%topic=${topicname}"
54 git push --no-thin ssh://${username}@${url}:${port}/${project} HEAD:refs/for/${branch}%topic=${topicname}
55 fi
56 echo ""
57
58 cd - > /dev/null
59
60done < vendor/omni/utils/caf-repos-list