forked from cms-sw/cms-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauto-update-git-branches
executable file
·111 lines (92 loc) · 3.42 KB
/
auto-update-git-branches
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/sh -ex
# Updates a branch by doing the following:
# - switch to the target branch
# - Merge the source branch but keep anything on the development branch
# in case of conflicts.
# - Update the target branch.
function updateBranch()
{
SOURCE_BRANCH=$1
TARGET_BRANCH=$2
git clean -fdx
git reset --hard origin/$TARGET_BRANCH
git clean -fdx
git merge --no-ff -X ours origin/$SOURCE_BRANCH
git commit --amend -m "Merge $SOURCE_BRANCH into $TARGET_BRANCH."
if [ "X`git diff --name-only HEAD origin/$TARGET_BRANCH | tail -1`" != "X" ]; then
git push origin HEAD:$TARGET_BRANCH
fi
}
# Update CMSSW
# Clone once
cd $WORKSPACE
rm -rf cmssw
if [ ! -d cmssw ]; then
git clone [email protected]:cms-sw/cmssw
fi
cd cmssw
# Make sure we push with our correct name and address
# in the case our user does not have an home directory,
# e.g. under mesos.
if [ X$HOME = X ]; then
git config user.email '[email protected]'
git config user.name "CMS Build"
fi
git fetch origin
# CMSSW_7_1_X for the moment is based on CMSSW_7_0_X
# SLHC branch is based on top of the associated release branch.
(updateBranch CMSSW_6_2_X CMSSW_6_2_X_SLHC) || true
(updateBranch CMSSW_6_2_X_SLHC CMSSW_6_2_SLHCDEV_X) || true
# CMSSW_7_2_X for the moment is based on CMSSW_7_1_X
# CMSSW_7_3_X special branches
# CMSSW_7_4_X
(updateBranch CMSSW_7_4_X CMSSW_7_4_DEVEL_X) || true
(updateBranch CMSSW_7_4_X CMSSW_7_4_THREADED_X) || true
(updateBranch CMSSW_7_4_X CMSSW_7_4_ROOT6_X) || true
(updateBranch CMSSW_7_4_X CMSSW_7_4_GEANT10_X) || true
(updateBranch CMSSW_7_4_X CMSSW_7_4_CLANG_X) || true
(updateBranch CMSSW_7_4_X CMSSW_7_4_ROOT5_X) || true
# CMSSW_7_5_X
(updateBranch CMSSW_7_4_X CMSSW_7_5_X) || true
(updateBranch CMSSW_7_5_X CMSSW_7_5_ROOT5_X) || true
# Update CMSDIST
cd $WORKSPACE
if [ ! -d cmsdist ]; then
git clone -b IB/CMSSW_7_0_X/stable [email protected]:cms-sw/cmsdist
fi
cd cmsdist
# Make sure we push with our correct name and address
# in the case our user does not have an home directory,
# e.g. under mesos.
if [ X$HOME = X ]; then
git config user.email '[email protected]'
git config user.name "CMS Build"
fi
git fetch
# CMSSW_6_2_X
(updateBranch IB/CMSSW_6_2_X/stable IB/CMSSW_6_2_X/devel-gcc472) || true
# CMSSW_7_0_X
# devel
# CMSSW_7_1_X
(updateBranch IB/CMSSW_7_0_X/stable IB/CMSSW_7_1_X/stable) || true
# CMSSW_7_2_X
# CMSSW_7_3_X
(updateBranch IB/CMSSW_7_3_X/stable IB/CMSSW_7_3_X/gcc491) || true
(updateBranch IB/CMSSW_7_3_X/stable IB/CMSSW_7_3_X/root6) || true
(updateBranch IB/CMSSW_7_3_X/stable IB/CMSSW_7_3_X/next) || true
(updateBranch IB/CMSSW_7_3_X/stable IB/CMSSW_7_3_X/debug) || true
# CMSSW_7_4_X
# Since the production arch for 74X is gcc491, IB/CMSSW_7_3_X/491
# merges into IB/CMSSW_7_4_X/stable Then it merges into the
# other cmsdist branches for 74X as usual
(updateBranch IB/CMSSW_7_4_X/stable IB/CMSSW_7_4_X/gcc481) || true
(updateBranch IB/CMSSW_7_4_X/stable IB/CMSSW_7_4_X/next) || true
(updateBranch IB/CMSSW_7_4_X/stable IB/CMSSW_7_4_X/root6) || true
(updateBranch IB/CMSSW_7_4_X/stable IB/CMSSW_7_4_X/geant10) || true
(updateBranch IB/CMSSW_7_4_X/stable IB/CMSSW_7_4_X/debug) || true
(updateBranch IB/CMSSW_7_4_X/stable IB/CMSSW_7_4_X/root5) || true
# CMSSW_7_5_X
(updateBranch IB/CMSSW_7_4_X/stable IB/CMSSW_7_5_X/stable) || true
(updateBranch IB/CMSSW_7_5_X/stable IB/CMSSW_7_5_X/gcc481) || true
(updateBranch IB/CMSSW_7_5_X/stable IB/CMSSW_7_5_X/next) || true
(updateBranch IB/CMSSW_7_5_X/stable IB/CMSSW_7_5_X/root5) || true