source: trunk/contrib/make-release.sh @ 1425

Last change on this file since 1425 was 1425, checked in by gogo, 2 years ago

More improvement to release process.

File size: 3.9 KB
Line 
1#!/bin/bash
2
3if ! [ -f XinhaCore.js ]
4then
5  echo "Run this from the root of your working copy." >&2
6  echo                                                >&2
7  exit 1
8fi
9
10
11if ! [ -d .svn ]
12then
13  echo "This script must be run inside a subversion working copy." >&2
14  echo                                                             >&2
15  exit 1
16fi
17
18if [ "$1" = "" ]
19then
20  echo "Usage: $0 {VersionNumber}"                    >&2
21  echo                                                >&2
22  exit 1
23fi
24
25# Run this with bash from the root of your SVN working copy checkout of the trunk
26# it will dump int /tmp the archived release files
27# eg bash contrib/make-release.sh
28
29VER="$1"
30
31# Update plugin Manifest
32MANIFEST="$(bash contrib/generate-plugin-manifest.sh | sort | perl -0777 -pe 's/,\s*$//s' )"
33cat XinhaCore.js | perl -0777  -pe 's/(.pluginManifest\s+=)\s+.+?;/\1 {\nPUT_THE_MANIFEST_HERE_YO\n};/is' | replace PUT_THE_MANIFEST_HERE_YO "$MANIFEST" >XinhaCore2.js
34mv XinhaCore2.js XinhaCore.js
35
36# Export
37mkdir /tmp/xinha-$VER
38svn export $(pwd) /tmp/xinha-$VER/xinha
39cd /tmp/xinha-$VER/xinha
40echo "xinha-$VER" >VERSION.TXT
41
42# Create the merged language files
43php contrib/lc_parse_strings.php
44for lang in $(find . -wholename "*/lang/*.js" | sed -r 's/.*\///' | sort | uniq | grep -v base | sed -r 's/.js//')
45do
46  php contrib/lc_create_merged_file.php $lang lang/merged/$lang.js
47done
48php contrib/lc_create_merged_file.php NEW lang/merged/__new__.js
49
50
51cd ../
52
53# Create the main distribution zip and bz2
54zip -r xinha-$VER.zip        xinha
55tar -cjvf xinha-$VER.tar.bz2 xinha
56
57# Make a stripped down plugins set for the plugins which must be run locally
58#  ie, ones that upload files or deal with the local server file system
59mkdir xinha-cdn
60mkdir xinha-cdn/contrib
61mkdir xinha-cdn/plugins
62cp -rp xinha/contrib/php-xinha.php         xinha-cdn/contrib
63cp -rp xinha/contrib/.htaccess             xinha-cdn/contrib
64cp -rp xinha/plugins/MootoolsFileManager   xinha-cdn/plugins
65cp -rp xinha/plugins/Linker                xinha-cdn/plugins
66cp -rp xinha/examples                      xinha-cdn/examples
67
68# Some examples are not appropriate for the cdn
69rm -rf xinha-cdn/examples/Old_Newbie_Guide
70rm -rf xinha-cdn/examples/ExtendedDemo.html
71rm -rf xinha-cdn/examples/files/ext_example*php
72rm -rf xinha-cdn/examples/files/Extended.html
73
74# Comment out some examples from the index
75cat xinha-cdn/examples/index.html | sed -r 's/<h2>Exper/<!-- These are not applicable in a CDN environment: <h2>Exper/' | sed -r 's/(<.body>)/-->\1/' >xinha-cdn/examples/index.html.2
76mv xinha-cdn/examples/index.html.2  xinha-cdn/examples/index.html
77
78# Replace the XinhaEasy.js link to the "CDN" link
79for file in xinha-cdn/examples/*
80do
81  replace "../XinhaEasy.js" "//s3-us-west-1.amazonaws.com/xinha/xinha-${VER}/XinhaEasy.js" -- $file
82done
83
84cat >xinha-cdn/README.TXT <<'EOF'
85Xinha CDN Local Distribution
86--------------------------------------------------------------------------------
87
88This directory contains plugins for Xinha (www.xinha.org) which must be run on
89the local web server rather than from an external server/content delivery
90network.
91
92Consult the NewbieGuide ( http://trac.xinha.org/wiki/Documentation/NewbieGuide )
93for complete details on Xinha configuration and see the examples in the directory
94here for, err, examples.
95
96Especially take note of examples/UsingPhpPlugins.php
97
98EOF
99echo "xinha-$VER" >xinha-cdn/VERSION.TXT
100zip -r    xinha-cdn.zip     xinha-cdn
101tar -cjvf xinha-cdn.tar.bz2 xinha-cdn
102
103# Update the s3 bucket
104read -p "Upload to \"s3://xinha/xinha-${VER}/\"? [yN]: "
105if [ "$REPLY" == "y" ] || [ "$REPLY" == "Y" ]
106then
107  cd xinha
108  s3cmd --delete-removed sync ./ s3://xinha/xinha-${VER}/
109  cd ..
110fi
111
112read -p "Upload to \"s3://xinha/xinha-latest/\"? [yN]: "
113if [ "$REPLY" == "y" ] || [ "$REPLY" == "Y" ]
114then
115  cd xinha
116  s3cmd --delete-removed sync ./ s3://xinha/xinha-latest/
117  cd ..
118fi
119
120cd xinha
121php contrib/compress_yui.php
122sleep 5
123cd ../
124zip -r    xinha-compressed-$VER.zip     xinha
125tar -cjvf xinha-compressed-$VER.tar.bz2 xinha
126
Note: See TracBrowser for help on using the repository browser.