new release scripts
[phpmyadmin/crack.git] / scripts / create-release.sh
blob1879339f19e1d1204ff423b09cda4a09029189b9
1 #!/bin/sh
3 # $Id$
4 # vim: expandtab sw=4 ts=4 sts=4:
6 # 2005-09-13, lem9@users.sourceforge.net
7 # - no longer create a config.default.php from config.inc.php
9 # 2005-06-12, lem9@users.sourceforge.net
10 # - cvs server name changed to cvs, because cvs1 no longer works from
11 # shell.sourceforge.net
13 # 2003-08-23, nijel@users.sourceforge.net:
14 # - support for creating snapshots outside sourceforge:
15 # * cvs server name can be read from environment variable cvsserver
16 # * do not change to directories as used on sourceforge if $2 is local
18 # 2003-08-13, nijel@users.sourceforge.net:
19 # - config.default -> config.default.php
21 # 2004-08-09, lem9@users.sourceforge.net:
22 # - remember to create a new bug tracking group
24 # 2004-06-07 rabus@users.sourceforge.net
25 # - create backup config file
27 # 2004-04-29, lem9@users.sourceforge.net:
28 # - keep only the previous cvs directory created
30 # 2004-04-16, lem9@users.sourceforge.net:
31 # - daily snapshot when called with first parameter "snapshot"
32 # - remove directory used for the checkout
34 # 2003-11-18, nijel@users.sourceforge.net:
35 # - switch php3 -> php
37 # 2003-10-10, nijel@users.sourceforge.net:
38 # - cvsserver set on just one place to ease testing
39 # - echoes md5 sums to include on download page
41 # 2003-06-22, robbat2@users.sourceforge.net:
42 # - Moved to using updatedocs.sh for updating documentation
43 # - Make tarring faster by re-arranging ops
45 # 2003-01-17, rabus@users.sourceforge.net:
46 # - Changed the CVS hostname to cvs1 because cvs1.sourceforge.net is now blocked
47 # for the SF shell servers, too. Note: The script now works on the SF shell
48 # servers ONLY!
50 # 2002-11-22, rabus@users.sourceforge.net:
51 # - changed the CVS server dns to cvs1.sourceforge.net
52 # (cvs.phpmyadmin.sourceforge.net does not work at the SF shell anymore).
54 # 2002-10-03, rabus@users.sourceforge.net:
55 # - more detailed instructions
57 # 2002-09-08, robbat2@users.sourceforge.net:
58 # - Tweaked final instruction list
60 # 2002-06-17, lem9@users.sourceforge.net:
61 # - I option to tar for bzip2 is deprecated, use j
63 # 2002-27-04, loic@phpmyadmin.net:
64 # - added the cvs branch feature
66 # 2001-08-08, swix@users.sourceforge.net:
67 # - created script
68 # - added release todo list
71 cvsserver=${cvsserver:-phpmyadmin.cvs.sourceforge.net}
72 KITS="all-languages-utf-8-only all-languages english"
73 COMPRESSIONS="zip-7z tbz tgz 7z"
75 # third param is the user; when creating a release we don't want
76 # to suffer from the delay between anonymous cvs and developer cvs
78 if [ $# = 0 ]
79 then
80 echo "Usage: create-release.sh version from_branch devname"
81 echo " (no spaces allowed!)"
82 echo ""
83 echo "Example: create-release.sh 2.9.0-rc1 QA_2_9 lem9"
84 exit 65
87 if [ "$1" = "snapshot" ]
88 then
89 branch=''
90 elif [ "$#" -ge 2 ]
91 then
92 branch="-r $2"
95 user="anonymous"
96 if [ "$#" -eq 3 ]
97 then
98 user=$3
102 if [ $1 = "snapshot" ]
103 then
104 mode="snapshot"
105 date_snapshot=`date +%Y%m%d-%H%M%S`
108 # Set target name
109 if [ "$mode" != "snapshot" ]
110 then
111 target=$1
112 else
113 target=$date_snapshot
117 if [ "$mode" != "snapshot" ]
118 then
120 cat <<END
122 Please ensure you have:
123 1. incremented rc count or version in CVS :
124 - in libraries/Config.class.php PMA_Config::__constructor() the line
125 " $this->set( 'PMA_VERSION', '2.7.1-dev' ); "
126 - in Documentation.html the 2 lines
127 " <title>phpMyAdmin $1 - Documentation</title> "
128 " <h1>phpMyAdmin $1 Documentation</h1> "
129 - in translators.html
130 - in README
131 2. synchronized the language files:
132 cd lang
133 ./sync_lang.sh
134 and checked all language files are valid (use
135 the "./scripts/check_lang.php" script to do it).
137 Continue (y/n)?
139 printf "\a"
140 read do_release
142 if [ "$do_release" != 'y' ]; then
143 exit
147 if [ "$mode" = "snapshot" -a "$2" != "local" ] ; then
148 # Goto project dir
149 cd /home/groups/p/ph/phpmyadmin/htdocs
151 ## Move old cvs dir
152 #if [ -e cvs ];
153 #then
154 # mv cvs cvs-`date +%s`
157 # Keep one previous version of the cvs directory
158 if [ -e cvs-prev ];
159 then
160 rm -rf cvs-prev
162 mv cvs cvs-prev
165 # Do CVS checkout
166 mkdir cvs
167 cd cvs
169 if [ "$mode" != "snapshot" ] ; then
170 if grep -Fq ':pserver:anonymous@phpmyadmin.cvs.sourceforge.net:2401/cvsroot/phpmyadmin' ~/.cvspass ; then
171 echo "You seem to be already logged into phpMyAdmin CVS, skipping that"
172 else
173 if [ $user = "anonymous" ] ; then
174 echo "Press [ENTER]!"
175 cvs -q -d:pserver:anonymous@$cvsserver:/cvsroot/phpmyadmin login
176 if [ $? -ne 0 ] ; then
177 echo "CVS login failed, bailing out"
178 exit 1
184 if [ $user = "anonymous" ] ; then
185 cvs -q -z3 -d:pserver:anonymous@$cvsserver:/cvsroot/phpmyadmin co -P $branch phpMyAdmin
186 else
187 cvs -q -z3 -d:ext:$user@$cvsserver:/cvsroot/phpmyadmin co -P $branch phpMyAdmin
190 if [ $? -ne 0 ] ; then
191 echo "CVS checkout failed, bailing out"
192 exit 2
195 # Cleanup release dir
196 LC_ALL=C date -u > phpMyAdmin/RELEASE-DATE-${target}
198 # Olivier asked to keep those in the cvs release, to allow testers to use
199 # cvs update on it
200 if [ "$mode" != "snapshot" ]
201 then
202 find phpMyAdmin \( -name .cvsignore -o -name CVS \) -print0 | xargs -0 rm -rf
205 find phpMyAdmin -type d -print0 | xargs -0 chmod 755
206 find phpMyAdmin -type f -print0 | xargs -0 chmod 644
207 find phpMyAdmin \( -name '*.sh' -o -name '*.pl' \) -print0 | xargs -0 chmod 755
209 # Building Documentation.txt
210 LC_ALL=C w3m -dump phpMyAdmin/Documentation.html > phpMyAdmin/Documentation.txt
212 # Renaming directory
213 mv phpMyAdmin phpMyAdmin-$target
215 # Prepare all kits
216 for kit in $KITS ; do
217 # Copy all files
218 name=phpMyAdmin-$target-$kit
219 cp -r phpMyAdmin-$target $name
221 # Cleanup translations
222 cd phpMyAdmin-$target-$kit
223 scripts/lang-cleanup.sh $kit
224 cd ..
226 # Prepare distributions
227 for comp in $COMPRESSIONS ; do
228 case $comp in
229 tbz|tgz)
230 echo "Creating $name.tar"
231 tar cf $name.tar $name
232 if [ $comp = tbz ] ; then
233 echo "Creating $name.tar.bz2"
234 bzip2 -9k $name.tar
236 if [ $comp = tgz ] ; then
237 echo "Creating $name.tar.gz"
238 gzip -9c $name.tar > $name.tar.gz
240 rm $name.tar
242 zip)
243 echo "Creating $name.zip"
244 zip -q -9 -r $name.zip $name
246 zip-7z)
247 echo "Creating $name.zip"
248 7za a -bd -tzip $name.zip $name > /dev/null
251 echo "Creating $name.7z"
252 7za a -bd $name.7z $name > /dev/null
255 echo "WARNING: ignoring compression '$comp', not known!"
257 esac
258 done
260 # Remove directory with current dist set
261 rm -rf $name
262 done
264 # Cleanup
265 rm -rf phpMyAdmin-${target}
267 if [ "$mode" != "snapshot" ]
268 then
271 echo ""
272 echo ""
273 echo ""
274 echo "Files:"
275 echo "------"
277 ls -la *.gz *.zip *.bz2 *.7z
279 echo
280 echo "MD5 sums:"
281 echo "--------"
283 md5sum *.{gz,zip,bz2,7z} | sed "s/\([^ ]*\)[ ]*\([^ ]*\)/\$md5sum['\2'] = '\1';/"
285 echo
286 echo "Sizes:"
287 echo "------"
289 ls -l --block-size=k *.{gz,zip,bz2,7z} | sed -r "s/[a-z-]+[[:space:]]+[0-9]+[[:space:]]+[^[:space:]]+[[:space:]]+[^[:space:]]+[[:space:]]+([0-9]*)K.*[[:space:]]([^[:space:]]+)\$/\$size['\2'] = \1;/"
291 echo
292 echo "Add these to /home/groups/p/ph/phpmyadmin/htdocs/home_page/files.inc.php on sf"
294 cat <<END
297 Todo now:
298 ---------
299 1. tag the cvs tree with the new revision number for a plain release or a
300 release candidate:
301 version 2.7.0 gets two tags: RELEASE_2_7_0 and STABLE
302 version 2.7.1-rc1 gets RELEASE_2_7_1RC1 and TESTING
304 2. upload the files to SF:
305 ftp upload.sourceforge.net
306 cd incoming
307 binary
308 mput cvs/*.gz *.zip *.bz2
309 3. add files to SF files page (cut and paste changelog since last release)
310 4. add SF news item to phpMyAdmin project
311 5. update web page:
312 - add MD5s and file sizes to /home/groups/p/ph/phpmyadmin/htdocs/home_page/includes/list_files.inc.php
313 - add release to /home/groups/p/ph/phpmyadmin/htdocs/home_page/includes/list_release.inc.php
314 6. announce release on freshmeat (http://freshmeat.net/projects/phpmyadmin/)
315 7. send a short mail (with list of major changes) to
316 phpmyadmin-devel@lists.sourceforge.net
317 phpmyadmin-news@lists.sourceforge.net
318 phpmyadmin-users@lists.sourceforge.net
320 Don't forget to update the Description section in the announcement,
321 based on Documentation.html.
323 8. increment rc count or version in CVS :
324 - in libraries/Config.class.php PMA_Config::__constructor() the line
325 " $this->set( 'PMA_VERSION', '2.7.1-dev' ); "
326 - in Documentation.html the 2 lines
327 " <title>phpMyAdmin 2.2.2-rc1 - Documentation</title> "
328 " <h1>phpMyAdmin 2.2.2-rc1 Documentation</h1> "
329 - in translators.html
331 9. add a group for bug tracking this new version, at
332 https://sourceforge.net/tracker/admin/index.php?group_id=23067&atid=377408&add_group=1
334 10. Visit http://phpmyadmin.net/home_page/version.php then copy the results to /home/groups/p/ph/phpmyadmin/htdocs/latest.txt. This is needed for users of the pre-2.8.0 scripts/upgrade.pl.
336 11. the end :-)
342 if [ "$mode" = "snapshot" -a "$2" != "local" ] ; then
343 cd ..
344 find cvs -type d -print0 | xargs -0 chmod 775
345 find cvs -type f -print0 | xargs -0 chmod 664
348 # Removed due to not needed thanks to clever scripting by Robbat2
349 # 9. update the demo subdirectory:
350 # - in htdocs, cvs update phpMyAdmin
351 # - and don't forget to give write rights for the updated scripts to the
352 # whole group