-
-
Notifications
You must be signed in to change notification settings - Fork 461
/
ocb-sync.sh
executable file
·41 lines (38 loc) · 1.22 KB
/
ocb-sync.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
# This script is meant to keep the github OCA/OCB and odoo/odoo in sync.
# Technically, it simply merges odoo into the repective branch in OCB, thereby
# keeping commit identifiers stable (that as opposed to a rebase approach,
# where commit hashes are rewritten)
# The following variables can be overriden by a file called ocb-sync.sh.conf
# in the same directory as this file.
ODOO="[email protected]:/odoo/odoo.git"
OCB="[email protected]:/OCA/OCB.git"
BRANCHES="18.0 17.0 16.0 15.0"
GITDIR="/var/tmp/git"
PUBDIR="/var/tmp/ocb-nightly"
BUILDDIR="/var/tmp/ocb-build"
if [ -f $(dirname $0)/$(basename $0).conf ]; then
. $(dirname $0)/$(basename $0).conf
fi
if [ ! -d $GITDIR ]; then
mkdir -p $GITDIR
fi
cd $GITDIR
if [ ! -d $(basename $OCB .git) ]; then
git clone $OCB
cd $(basename $OCB .git)
git remote add odoo $ODOO
cd ..
fi
cd $(basename $OCB .git)
git fetch --all
for BRANCH in $BRANCHES; do
git checkout origin/$BRANCH -B $BRANCH
git pull --ff-only
git merge --no-edit odoo/$BRANCH || exit 1
git push -u origin HEAD:$BRANCH || exit 1
# cd setup || exit 1
# python package.py --no-testing --no-debian --no-rpm --no-windows -b $BUILDDIR -p $PUBDIR/$BRANCH || exit 1
# cd ..
done
exit 0