-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmk-release-series.sh
More file actions
executable file
·166 lines (146 loc) · 5.07 KB
/
Copy pathmk-release-series.sh
File metadata and controls
executable file
·166 lines (146 loc) · 5.07 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#!/bin/sh
. ~/.server.config || exit $?
# Find latest version number
cd $SQUID_VCS_PATH
OLDVER=`ls -1t $SQUID_VCS_PATH | cut -d- -f2 | sort -h | tail -n 1`
NEWVER=$(( OLDVER + 1 ))
nuclearFallout ()
{
# wipeout the rsync staging area
rm -rf $SQUID_RSYNC_PATH/squid-$NEWVER
# wipeout the WWW staging area
rm -rf $SQUID_WWW_PATH/content/Versions/v$NEWVER
# wipeout the VCS new version staging
cd $SQUID_VCS_PATH/squid-$NEWVER &&
git checkout master &&
(
git branch -dD v$NEWVER-bootstrap || true
git branch -dD v$NEWVER-maintenance || true
git branch -dD v$NEWVER-next-backports || true
)
cd $SQUID_VCS_PATH &&
rm -rf $SQUID_VCS_PATH/squid-$NEWVER
echo ""
echo " TODO MANUALLY destroy github squid-cache/squid branch v$NEWVER-maintenance"
echo " TODO MANUALLY run: git fetch --all --prune"
echo ""
# rollback the old version to BETA status
echo "master" >$SQUID_VCS_PATH/squid-$OLDVER/.BASE
# wipeout VCS old version staging branches
cd $SQUID_VCS_PATH/squid-$OLDVER
git checkout v$OLDVER-maintenance &&
git branch -dD v$OLDVER
echo ""
echo " TODO MANUALLY destroy github squid-cache/squid branch v$OLDVER"
echo " TODO MANUALLY run: git fetch --all --prune"
echo ""
exit 1
}
if ! test -f $SQUID_VCS_PATH/squid-$OLDVER/.BASE ; then
echo "ERROR: Squid-$OLDVER has already been promoted to Beta."
else
echo " . Promoting Squid-$OLDVER to Beta Release ..."
cd squid-$OLDVER
git checkout `cat .BASE` &&
git checkout -b v$OLDVER &&
git push -u origin v$OLDVER &&
git push -u github v$OLDVER &&
rm .BASE || nuclearFallout
fi
if test -d $SQUID_VCS_PATH/squid-$NEWVER ; then
echo "ERROR: Squid-$NEWVER already exists."
exit 1
else
echo " . Creating Squid-$NEWVER development release series ..."
cd $SQUID_VCS_PATH
git clone git@github.com:squidadm/squid.git squid-$NEWVER
cd squid-$NEWVER
git remote add github git@github.com:squid-cache/squid.git
echo "master" >.BASE
ln -s $SQUID_VCS_PATH/gitignore $SQUID_VCS_PATH/squid-$NEWVER/.git/info/exclude
echo " .. Creating maintenance branches ..."
git checkout -b v${NEWVER}-bootstrap &&
git push -u origin v${NEWVER}-bootstrap
git checkout -b v${NEWVER}-maintenance &&
git push -u origin v${NEWVER}-maintenance
git checkout -b v${NEWVER}-next-backports &&
git push -u origin v${NEWVER}-next-backports
fi
#
## Update "master" branch code
#
cd $SQUID_VCS_PATH/squid-$NEWVER
git checkout -b v${NEWVER}-release-prep &&
git push -u origin v${NEWVER}-release-prep
echo " .. update configure.ac ..."
sed -e s/${OLDVER}.0.0-VCS/${NEWVER}.0.0-VCS/ <configure.ac >configure.ac.2 &&
mv configure.ac.2 configure.ac &&
git add configure.ac
echo " .. add Release Notes ..."
cp doc/release-notes/template.sgml doc/release-notes/release-${NEWVER}.sgml.in &&
git add doc/release-notes/release-${NEWVER}.sgml.in
changes=`git diff HEAD`
if test -n "$changes" ; then
git commit -m "${NEWVER}.0.0" &&
git push &&
gh pr create --repo squid-cache/squid --base master --fill ||
(
echo ""
echo "MANUALLY: check and perform PR creation for v${NEWVER}-maintenance branch"
echo ""
# Do not take nuclear option automatically.
# an error here is not harmful to the process.
)
else
echo ""
echo "ERROR: unexpected 'git diff HEAD' in v${NEWVER}-maintenance."
echo "ERROR: do this commit manually and submit PR."
echo ""
nuclearFallout
fi
#
## Publich RSYNC
#
echo " . Creating RSYNC share directory for squid-$NEWVER .."
mkdir $SQUID_RSYNC_PATH/squid-$NEWVER || nuclearFallout
# content generated by snapshot automation
#
## Publish WWW content
#
echo " . Creating WWW directories for squid-$NEWVER .."
cd $SQUID_WWW_PATH/content/Versions/
echo " .. populating Versions/v$NEWVER/ ..."
mkdir v$NEWVER &&
cd v$NEWVER &&
chmod g+w . || nuclearFallout
for page in index.dyn ChangeLog.dyn RELEASENOTES.dyn CONTRIBUTORS.txt ; do
cp -p ../v$OLDVER/$page . || nuclearFallout
done
ln -s ../sig.dyn sig.dyn || nuclearFallout
for subd in cfgman manuals changesets ; do
mkdir $subd || nuclearFallout
chmod g+w $subd || nuclearFallout
done
echo " .. populating Versions/v$NEWVER/changesets/ ..."
## TODO drop the whole changesets/ system
cd $SQUID_WWW_PATH/content/Versions/v$NEWVER/changesets/ &&
(
echo "Squid $NEWVER" >.version
for page in .lastrevno .lastupdate ; do
cp -p ../../v$OLDVER/changesets/$page . || /bin/true
done
## TODO move these scripts to CI/release or drop
ln -s /home/squidadm/bin/update-patches-git .update
ln -s /home/squidadm/bin/maint-group-patches .group
ln -s /home/squidadm/bin/maint-merged-patches .merged
ln -s /home/squidadm/bin/maint-nomerge-patches .nomerge
./.update
) || nuclearFallout
## TODO update the web server VCS system with the new files we just created
echo " ."
echo "."
echo ""
echo " TODO Manual Check that http://master.squid-cache.org/Versions/v$NEWVER/ is correct"
echo ""
echo " TODO Manual update of Versions/index.dyn table"
echo ""