source: Dev/trunk/src/client/util/buildscripts/build_release.sh @ 483

Last change on this file since 483 was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

  • Property svn:executable set to *
File size: 6.2 KB
Line 
1#!/bin/bash
2
3# version should be something like 0.9.0beta or 0.9.0
4version=$1
5
6# svnUserName is the name you use to connect to Dojo's subversion.
7svnUserName=$2
8
9# The svn revision number to use for tag. Should be a number, like 11203
10svnRevision=$3
11
12# If no svnRevision number, get the latest one from he repo.
13if [ "$svnRevision" = "" ]; then
14        svnRevision=`svn info http://svn.dojotoolkit.org/src/branches/1.9/util/buildscripts/build_release.sh | grep Revision | sed 's/Revision: //'`
15fi
16
17tagName=release-$version
18buildName=dojo-$tagName
19
20echo "This is a RELEASE build for Dojo, you probably meant to run build.sh"
21read -p "If you mean to create a tag for Dojo $version from r$svnRevision ... press a key to continue."
22
23# Make the SVN tag.
24svn mkdir -m "Using r$svnRevision to create a tag for the $version release." https://svn.dojotoolkit.org/src/tags/$tagName
25svn copy -r $svnRevision https://svn.dojotoolkit.org/src/branches/1.9/dojo  https://svn.dojotoolkit.org/src/tags/$tagName/dojo -m "Using r$svnRevision to create a tag for the $version release."
26svn copy -r $svnRevision https://svn.dojotoolkit.org/src/branches/1.9/dijit https://svn.dojotoolkit.org/src/tags/$tagName/dijit -m "Using r$svnRevision to create a tag for the $version release."
27svn copy -r $svnRevision https://svn.dojotoolkit.org/src/branches/1.9/dojox https://svn.dojotoolkit.org/src/tags/$tagName/dojox -m "Using r$svnRevision to create a tag for the $version release."
28svn copy -r $svnRevision https://svn.dojotoolkit.org/src/branches/1.9/util  https://svn.dojotoolkit.org/src/tags/$tagName/util -m "Using r$svnRevision to create a tag for the $version release."
29svn copy -r $svnRevision https://svn.dojotoolkit.org/src/branches/1.9/demos https://svn.dojotoolkit.org/src/tags/$tagName/demos -m "Using r$svnRevision to create a tag for the $version release."
30
31# Check out the tag
32mkdir ../../build
33cd ../../build
34svn co https://svn.dojotoolkit.org/src/tags/$tagName $buildName
35cd $buildName/util/buildscripts
36
37# Update the dojo version in the tag
38java -jar ../shrinksafe/js.jar changeVersion.js $version $svnRevision ../../dojo/_base/kernel.js
39java -jar ../shrinksafe/js.jar changeVersion.js $version $svnRevision ../../dojo/package.json
40java -jar ../shrinksafe/js.jar changeVersion.js $version $svnRevision ../../dijit/package.json
41java -jar ../shrinksafe/js.jar changeVersion.js $version $svnRevision ../../dojox/package.json
42cd ../../dojo
43svn commit -m "Updating dojo version for the tag. \!strict" package.json _base/kernel.js
44cd ../dijit
45svn commit -m "Updating dijit version for the tag. \!strict" package.json
46cd ../dojox
47svn commit -m "Updating dojox version for the tag. \!strict" package.json
48
49# Erase the SVN dir and replace with an exported SVN contents.
50cd ../..
51rm -rf ./$buildName/
52svn export http://svn.dojotoolkit.org/src/tags/$tagName $buildName
53
54# clobber cruft that we don't want in builds
55rm -rf ./$buildName/dijit/themes/noir
56rm -rf ./$buildName/dijit/bench
57
58# Make a shrinksafe bundle
59shrinksafeName=$buildName-shrinksafe
60cp -r $buildName/util/shrinksafe $buildName/util/$shrinksafeName
61cd $buildName/util
62zip -rq $shrinksafeName.zip $shrinksafeName/
63tar -zcf $shrinksafeName.tar.gz $shrinksafeName/
64mv $shrinksafeName.zip ../../
65mv $shrinksafeName.tar.gz ../../
66cd ../..
67rm -rf $buildName/util/$shrinksafeName
68
69# Make a -demos bundle (note, this is before build. Build profile=demos-all if you want to release them)
70# the -demos archives are meant to be extracted from the same folder -src or release archives, and have
71# a matching prefixed folder in the archive
72demoName=$buildName-demos
73zip -rq $demoName.zip $buildName/demos/
74tar -zcf $demoName.tar.gz $buildName/demos/
75# prevent demos/ from appearing in the -src build
76rm -rf $buildName/demos
77
78# Make a src bundle
79srcName=$buildName-src
80mv $buildName $srcName
81zip -rq $srcName.zip $srcName/
82tar -zcf $srcName.tar.gz $srcName/
83mv $srcName $buildName
84
85# Run the build.
86cd $buildName/util/buildscripts/
87chmod +x ./build.sh
88./build.sh profile=standard version=$1 releaseName=$buildName cssOptimize=comments.keepLines optimize=shrinksafe.keepLines action=release insertAbsMids=1
89# remove tests and demos, but only for the actual release:
90chmod +x ./clean_release.sh
91./clean_release.sh ../../release $buildName
92cd ../../release/
93
94# Pause to allow manual process of packing Dojo.
95currDir=`pwd`
96echo "You can find dojo in $currDir/$buildName/dojo/dojo.js"
97read -p "Build Done. If you want to pack Dojo manually, do it now, then press Enter to continue build packaging..."
98
99# Continuing with packaging up the release.
100zip -rq $buildName.zip $buildName/
101tar -zcf $buildName.tar.gz $buildName/
102mv $buildName.zip ../../
103mv $buildName.tar.gz ../../
104
105# copy compressed and uncompressed Dojo to the root
106cp $buildName/dojo/dojo.js* ../../
107
108# remove the testless release build, and unpack a -src archive to rebuild from
109cd ../../
110rm -rf $buildName/
111tar -xzvf $srcName.tar.gz
112cd $srcName/util/buildscripts/
113
114# build the version that will be extracted and live on downloads.dojotoolkit.org (with tests)
115./build.sh action=release version=$1 profile=standard cssOptimize=comments.keepLines releaseName=$buildName copyTests=true mini=false insertAbsMids=1
116
117# cleanup the -src extraction, moving the newly built tree into place.
118cd ../../release
119mv $buildName ../../
120cd ..
121rm -rf release/
122
123cd ../../
124
125# make a folder structure appropriate for directly extracting on downloads.dojotoolkit.org
126mv build release-$1
127rm -rf release-$1/$srcName/
128cd release-$1
129
130# md5sum the release files -- OSX doesn't have md5sum, foundation servers don't have md5
131md5=`which md5`
132if [[ -n $md5 && -x $md5 ]]; then
133        echo "Found $md5";
134else
135        md5=`which md5sum`
136fi
137
138if [[ -n $md5 && -x $md5 ]]; then
139        for i in *.zip; do $md5 $i > $i.md5; done
140        for i in *.gz; do $md5 $i > $i.md5; done
141        for i in *.js; do $md5 $i > $i.md5; done
142else
143        echo "ERROR: Failed to generate md5 checksums"
144fi
145
146# pack up the whole thing for easy copying
147cd ..
148tar -czvf dj-$1-dtk.tar.gz release-$1
149
150# Finished.
151outDirName=`pwd`
152echo "Build complete. Files are in: $outDirName"
153echo "A copy/paste command to push files to download.dojotoolkit.org with permission:"
154echo "scp dj-$1-dtk.tar.gz download.dojotoolkit.org:/srv/www/vhosts.d/download.dojotoolkit.org"
155echo "... then extract in place and rm dj-$1-dtk.tar.gz"
Note: See TracBrowser for help on using the repository browser.