annotate scripts/makerelease.sh @ 3482:54d6336163fe trunk

Add release building scripts.
author William Pitcock <nenolod@atheme.org>
date Mon, 10 Sep 2007 00:47:18 -0500
parents
children 7b5353d0ae50
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3482
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
1 #!/bin/sh
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
2 # mkrelease.sh: Creates a release suitable for distfiles.atheme.org.
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
3 #
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
4 # Copyright (c) 2007 atheme.org
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
5 #
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
6 # Permission to use, copy, modify, and/or distribute this software for
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
7 # any purpose with or without fee is hereby granted, provided that the above
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
8 # copyright notice and this permission notice appear in all copies.
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
9 #
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
10 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
11 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
12 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
13 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
14 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
15 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
16 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
17 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
18 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
19 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
20 #
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
21
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
22 if [ "x$1" = "x" ]; then
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
23 echo "usage: $0 releasename [--automatic]"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
24 exit
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
25 else
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
26 RELEASENAME="$1"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
27 fi
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
28
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
29 if [ "x$2" = "x--automatic" ]; then
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
30 AUTOMATIC="yes"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
31 fi
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
32
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
33 TIP=`hg tip --template "#rev#:#node|short#"`
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
34
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
35 WRKDIR=`pwd`
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
36
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
37 if [ -d $RELEASENAME ]; then
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
38 echo "Deleting previous release named $RELEASENAME."
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
39 rm -rf $WRKDIR/$RELEASENAME/
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
40 fi
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
41
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
42 echo "Making release named $RELEASENAME (tip $TIP)"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
43
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
44 echo
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
45 echo "Building root: $RELEASENAME/"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
46 hg archive $RELEASENAME
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
47 cd $RELEASENAME
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
48 rm -rf autogen.sh autom4te.cache
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
49
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
50 # Run application specific instructions here.
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
51 if [ -x "$WRKDIR/application.sh" ]; then
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
52 source $WRKDIR/application.sh
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
53 fi
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
54
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
55 cd ..
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
56
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
57 echo "Building $RELEASENAME.tgz from $RELEASENAME/"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
58 tar zcf $RELEASENAME.tgz $RELEASENAME/
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
59
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
60 echo "Building $RELEASENAME.tbz2 from $RELEASENAME/"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
61 tar jcf $RELEASENAME.tbz2 $RELEASENAME/
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
62
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
63 PUBLISH="yes"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
64
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
65 ok="0"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
66 if [ "x$AUTOMATIC" != "xyes" ]; then
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
67 echo
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
68 echo "Would you like to publish these releases now?"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
69 while [ $ok -eq 0 ]; do
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
70 echo -n "[$PUBLISH] "
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
71
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
72 read INPUT
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
73 case $INPUT in
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
74 [Yy]*)
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
75 PUBLISH="yes"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
76 ok=1
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
77 ;;
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
78 [Nn]*)
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
79 PUBLISH="no"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
80 ok=1
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
81 ;;
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
82 esac
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
83 done
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
84 fi
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
85
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
86 if [ "x$PUBLISH" = "xyes" ]; then
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
87 scp $RELEASENAME.tgz sidhe.atheme.org:/var/www/distfiles/htdocs
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
88 scp $RELEASENAME.tbz2 sidhe.atheme.org:/var/www/distfiles/htdocs
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
89
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
90 echo
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
91 echo "The releases have been published, and will be available to the entire"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
92 echo "distribution network within 15 minutes."
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
93 fi
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
94
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
95 echo
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
96 echo "Done. If you have any bugs to report, report them against"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
97 echo "the distfiles.atheme.org component at http://bugzilla.atheme.org"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
98 echo "Thanks!"
54d6336163fe Add release building scripts.
William Pitcock <nenolod@atheme.org>
parents:
diff changeset
99 echo