Files
openlayers/tools/update_dev_dir.sh
Tim Schaub f115c7a943 Use commit hash instead of (mock) svn rev.
When we upgraded to git, we didn't fully change over the way the website and examples are built.  The cron job that runs the update script only built the website & examples if the revision returned by the svn interface to the GitHub repo was different than the previously stored revision.  At some point, using `svn info` on the repo stopped being reliable.  For example, this is what I get when running this today (in 2012):

    svn info https://github.com/openlayers/openlayers/

    Path: openlayers
    URL: https://github.com/openlayers/openlayers
    Repository Root: https://github.com/openlayers/openlayers
    Repository UUID: d631b94f-4ba7-6298-eb8f-ce57b7db7bff
    Revision: 5488
    Node Kind: directory
    Last Changed Author: schuyler.erle
    Last Changed Rev: 5488
    Last Changed Date: 2006-05-12 12:35:22 -0700 (Fri, 12 May 2006)

(Last change looks like it was 6 years ago.)

We should be using a proper clone of the git repo and building the website and examples out of this.  Until then, we can at least use `git-ls-remote` to check what the latest HEAD from the canonical repo looks like.  This should get the website and examples building again (they stopped being updated a few weeks ago).
2012-05-09 19:48:51 -06:00

66 lines
2.3 KiB
Bash
Executable File

#!/bin/sh
# Used to update http://openlayers.org/dev/
# Get current 'Last Changed Rev'
GITREV=`git ls-remote https://github.com/openlayers/openlayers/ | grep HEAD | awk '{print $1}'`
SVNREV=`svn info http://svn.openlayers.org/ | grep 'Revision' | awk '{print $2}'`
# Get the last svn rev
touch /tmp/ol_git_rev
touch /tmp/ol_svn_rev
OLD_GITREV="o`cat /tmp/ol_git_rev`"
OLD_SVNREV="o`cat /tmp/ol_svn_rev`"
# If they're not equal, do some work.
if [ ! o$GITREV = $OLD_GITREV ]; then
svn revert -R /osgeo/openlayers/docs/dev
svn up /osgeo/openlayers/docs/dev
# Also update website
svn up /osgeo/openlayers/docs/
cd /osgeo/openlayers/docs/dev/tools/
python exampleparser.py
cd /osgeo/openlayers/docs/dev/build
./build.py -c closure tests.cfg
./build.py -c closure mobile.cfg OpenLayers.mobile.js
./build.py -c closure light.cfg OpenLayers.light.js
./build.py -c none tests.cfg OpenLayers.debug.js
./build.py -c none mobile.cfg OpenLayers.mobile.debug.js
./build.py -c none light.cfg OpenLayers.light.debug.js
cp OpenLayers.js ..
cp OpenLayers.*.js ..
cd ..
sed -i -e 's!../lib/OpenLayers.js?mobile!../OpenLayers.mobile.js!' examples/*.html
sed -i -e 's!../lib/OpenLayers.js!../OpenLayers.js!' examples/*.html
naturaldocs -i /osgeo/openlayers/docs/dev/lib -o HTML /osgeo/openlayers/dev/apidocs -p /osgeo/openlayers/docs/dev/apidoc_config -s Default OL >/dev/null
naturaldocs -i /osgeo/openlayers/docs/dev/lib -o HTML /osgeo/openlayers/dev/docs -p /osgeo/openlayers/docs/dev/doc_config -s Default OL >/dev/null
# Record the revision
echo -n $GITREV > /tmp/ol_git_rev
fi
if [ ! o$SVNREV = $OLD_SVNREV ]; then
svn up /osgeo/openlayers/dev/sandbox/
svn up /osgeo/openlayers/dev/addins/
# Record the revision
echo -n $SVNREV > /tmp/ol_svn_rev
fi
svn up /osgeo/openlayers/documentation-checkout
REV=`svn info /osgeo/openlayers/documentation-checkout | grep 'Last Changed Rev' | awk '{print $4}'`
# Get the last svn rev
touch /tmp/ol_doc_rev
OLD_REV="o`cat /tmp/ol_doc_rev`"
# If they're not equal, do some work.
if [ ! o$REV = $OLD_REV ]; then
cd /osgeo/openlayers/documentation-checkout
make html > /dev/null
cp -r _build/html/* /osgeo/openlayers/documentation
echo -n $REV > /tmp/ol_doc_rev
fi