blob: 5a1f47d62b37873d810b602510ff16d11ec76827 [file] [log] [blame]
Jake Whatley4e1248a2016-03-10 21:22:56 -05001#!/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
micky38788ad2212021-05-03 12:47:47 +020019echo -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}"
Jake Whatley4e1248a2016-03-10 21:22:56 -050025
26url="gerrit.omnirom.org"
27port="29418"
maxwen0b8f56b2023-10-07 15:32:48 +020028branch="android-14.0"
Jake Whatley4e1248a2016-03-10 21:22:56 -050029
30cd ../../../
31
32while read path;
33 do
34
Humberto Borba5dc4c6e2018-02-03 00:34:23 -020035 project=`echo android_${path} | sed -e 's/\//\_/g'`;
36 if [ "${path}" == "build" ] ; then
37 path="build/make";
Humberto Borba3429f952017-09-08 10:49:37 -030038 fi
Jake Whatley4e1248a2016-03-10 21:22:56 -050039
40 echo ""
41 echo "====================================================================="
42 echo " PROJECT: ${project} -> [ ${path}/ ]"
43 echo ""
44
45 cd $path;
46
47 echo " Pushing..."
micky38788ad2212021-05-03 12:47:47 +020048
49 if [[ "${OPERATION}" == "github" ]]; then
micky3870360c022023-12-08 15:41:58 +010050 echo " git push --no-thin -o skip-validation ssh://${username}@${url}:${port}/${project} HEAD:refs/heads/${branch}"
51 git push --no-thin -o skip-validation ssh://${username}@${url}:${port}/${project} HEAD:refs/heads/${branch}
micky38788ad2212021-05-03 12:47:47 +020052 elif [[ "${OPERATION}" == "gerrit" ]]; then
micky3870360c022023-12-08 15:41:58 +010053 echo " git push --no-thin -o skip-validation ssh://${username}@${url}:${port}/${project} HEAD:refs/for/${branch}%topic=${topicname}"
54 git push --no-thin -o skip-validation ssh://${username}@${url}:${port}/${project} HEAD:refs/for/${branch}%topic=${topicname}
micky38788ad2212021-05-03 12:47:47 +020055 fi
Jake Whatley4e1248a2016-03-10 21:22:56 -050056 echo ""
57
58 cd - > /dev/null
59
Humberto Borba87dbab22016-07-28 19:05:13 -030060done < vendor/omni/utils/aosp-forked-list