diff options
author | robocoder <anthon.pang@gmail.com> | 2010-12-19 09:56:20 +0300 |
---|---|---|
committer | robocoder <anthon.pang@gmail.com> | 2010-12-19 09:56:20 +0300 |
commit | 780ef0ba18c648ed93172d8cbd1b0ae769d2070c (patch) | |
tree | a2aaa563444ebc042a1313b39e2b854e93c43a22 /misc/package | |
parent | 9171461f1cceb6427ab0129ca578e6e899c907c2 (diff) |
fixes #1885; deferring Parallels support until their requirements have been reviewed
git-svn-id: http://dev.piwik.org/svn/trunk@3464 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'misc/package')
-rw-r--r-- | misc/package/build-last.sh | 67 | ||||
-rwxr-xr-x | misc/package/build.sh | 155 |
2 files changed, 155 insertions, 67 deletions
diff --git a/misc/package/build-last.sh b/misc/package/build-last.sh deleted file mode 100644 index fb1a011c4e..0000000000 --- a/misc/package/build-last.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash -VERSION="1.1b2" -DEST_PATH=/home/piwik/builds -URL_REPO=http://piwik@dev.piwik.org/svn/trunk -URL_TAGS=http://piwik@dev.piwik.org/svn/tags -HTTP_PATH=/home/www/builds.piwik.org - -function die() { - echo -e "$0: $1" - exit 2 -} - -if [ ! -e $DEST_PATH ] ; then - echo "Destination directory does not exists... Creating it !"; - mkdir -p $DEST_PATH; -fi - -echo "checkout repository for tag $VERSION" -rm -rf $DEST_PATH/piwik_last_version -svn export $URL_TAGS/$VERSION $DEST_PATH/piwik_last_version > /dev/null || die "Problem checking out the last version tag" - -echo "preparing release $VERSION " -cd $DEST_PATH -rm -rf $DEST_PATH/piwik -mv piwik_last_version piwik -echo `grep "'$VERSION'" piwik/core/Version.php` -if [ `grep "'$VERSION'" piwik/core/Version.php | wc -l` -ne 1 ] ; then - echo "version $VERSION not matching core/Version.php"; - exit -fi -rm -rf piwik/libs/PhpDocumentor-1.3.2/ -rm -rf piwik/libs/FirePHPCore/ -rm -rf piwik/tmp/cache/* -rm -rf piwik/tmp/logs/* -rm -rf piwik/tmp/templates_c/* -rm -f piwik/misc/db-schema* -rm -f piwik/misc/diagram_general_request* -cp piwik/tests/README.txt . -rm -rf piwik/tests/* -find piwik/plugins -name tests -type d -exec rm -rf {} \; 2> /dev/null -mv README.txt piwik/tests/ -cp piwik/misc/How\ to\ install\ Piwik.html . -cp piwik/misc/WebAppGallery/*.xml . - -echo "writing manifest file..." -find piwik -type f -printf '%s ' -exec md5sum {} \; | fgrep -v 'manifest.inc.php' | sed '1,$ s/\([0-9]*\) \([a-z0-9]*\) *piwik\/\(.*\)/\t\t"\3" => array("\1", "\2"),/; 1 s/^/<?php\n\/\/ This file is automatically generated during the Piwik build process\n class Manifest {\n\tstatic $files=array(\n/; $ s/$/\n\t);\n}/' > piwik/config/manifest.inc.php - -echo "packaging release..." -zip -r piwik-$VERSION.zip piwik How\ to\ install\ Piwik.html *.xml > /dev/null 2> /dev/null -tar -czf piwik-$VERSION.tar.gz piwik How\ to\ install\ Piwik.html *.xml -mv piwik-$VERSION.{zip,tar.gz} $HTTP_PATH -rm -rf piwik - -if [ `echo $VERSION | grep -E 'rc|b|a|alpha|beta|dev' -i | wc -l` -eq 1 ] ; then - echo "Beta or RC release"; - echo $VERSION > $HTTP_PATH/LATEST_BETA - echo "build finished! http://builds.piwik.org/piwik-$VERSION.zip" -else - echo "Stable release"; - #hard linking piwik.org/latest.zip to the newly created build - for i in zip tar.gz; do - ln -sf $HTTP_PATH/piwik-$VERSION.$i $HTTP_PATH/latest.$i - done - echo $VERSION > $HTTP_PATH/LATEST - echo "build finished! http://piwik.org/latest.zip" -fi - diff --git a/misc/package/build.sh b/misc/package/build.sh new file mode 100755 index 0000000000..720eeb0631 --- /dev/null +++ b/misc/package/build.sh @@ -0,0 +1,155 @@ +#!/bin/bash +# Syntax: build.sh version|'nightly'|'webtest' + +VERSION="$1" +DEST_PATH=/home/piwik/builds +URL_REPO=http://piwik@dev.piwik.org/svn/trunk +URL_TAGS=http://piwik@dev.piwik.org/svn/tags +HTTP_PATH=/home/www/builds.piwik.org + +# report error and exit +function die() { + echo -e "$0: $1" + exit 2 +} + +# clean up the workspace +function cleanupWorkspace() { + rm -rf piwik + rm -f *.html + rm -f *.xml + rm -f *.sql +} + +# organize files for packaging +function organizePackage() { + rm -rf piwik/libs/PhpDocumentor-1.3.2/ + rm -rf piwik/libs/FirePHPCore/ + rm -f piwik/libs/open-flash-chart/php-ofc-library/ofc_upload_image.php + + rm -rf piwik/tmp/* + rm -f piwik/misc/db-schema* + rm -f piwik/misc/diagram_general_request* + + cp piwik/tests/README.txt . + find piwik -name 'tests' -type d -prune -exec rm -rf {} \; + mkdir piwik/tests + mv README.txt piwik/tests/ + + cp piwik/misc/How\ to\ install\ Piwik.html . + if [ -e piwik/misc/package ]; then + cp piwik/misc/package/WebAppGallery/*.* . + rm -rf piwik/misc/package/ + else + if [ -e piwik/misc/WebAppGallery ]; then + cp piwik/misc/WebAppGallery/*.* . + rm -rf piwik/misc/WebAppGallery + fi + fi + + find piwik -type f -printf '%s ' -exec md5sum {} \; | fgrep -v 'manifest.inc.php' | sed '1,$ s/\([0-9]*\) \([a-z0-9]*\) *piwik\/\(.*\)/\t\t"\3" => array("\1", "\2"),/;' | sort | sed '1 s/^/<?php\n\/\/ This file is automatically generated during the Piwik build process\nclass Manifest {\n\tstatic $files=array(\n/; $ s/$/\n\t);\n}/' > piwik/config/manifest.inc.php +} + +if [ -z "$VERSION" ]; then + die "Expected a version number, 'nightly', or 'webtest' as a parameter" +fi + +case "$VERSION" in + "nightly" ) + if [ ! -e "${WORKSPACE}/trunk" ]; then + die "Piwik trunk not present!" + fi + + cleanupWorkspace + rm -f latest.zip + + cp -R trunk piwik + find piwik -name '.svn' -type d -prune -exec rm -rf {} \; + + organizePackage + + zip -q -r latest.zip piwik How\ to\ install\ Piwik.html *.xml *.sql > /dev/null 2> /dev/null + ;; + "webtest" ) + if [ ! -e "${WORKSPACE}/build/core/Version.php" ]; then + die "Piwik source files not present!" + fi + + cleanupWorkspace + rm -rf 1.0 + rm -f latest.zip + + cp -R build piwik + find piwik -name '.svn' -type d -prune -exec rm -rf {} \; + + organizePackage + + zip -q -r latest.zip piwik > /dev/null 2> /dev/null + + # Set-up infrastructure proxies for testing + LATESTVERSION=`fgrep VERSION build/core/Version.php | sed -e "s/\tconst VERSION = '//" | sed -e "s/'.*//"` + mkdir 1.0 + mkdir 1.0/getLatestVersion + cat >1.0/getLatestVersion/index.php <<GET_LATEST_VERSION +<?php + echo "${LATESTVERSION}"; +GET_LATEST_VERSION + + mkdir 1.0/subscribeNewsletter + cat >1.0/subscribeNewsletter/index.php <<SUBSCRIBE_NEWSLETTER +<?php + echo "ok"; +SUBSCRIBE_NEWSLETTER + ;; + * ) + if [ ! -e $DEST_PATH ] ; then + echo "Destination directory does not exist... Creating it!"; + mkdir -p $DEST_PATH; + fi + + cd $DEST_PATH + cleanupWorkspace + + echo "checkout repository for tag $VERSION" + rm -rf $DEST_PATH/piwik_last_version + svn export $URL_TAGS/$VERSION $DEST_PATH/piwik_last_version > /dev/null || die "Problem checking out the last version tag" + + echo "preparing release $VERSION" + + mv piwik_last_version piwik + echo `grep "'$VERSION'" piwik/core/Version.php` + if [ `grep "'$VERSION'" piwik/core/Version.php | wc -l` -ne 1 ]; then + echo "version $VERSION does not match core/Version.php"; + exit + fi + + echo "organizing files and writing manifest file..." + organizePackage + + echo "packaging release..." + zip -r piwik-$VERSION.zip piwik How\ to\ install\ Piwik.html > /dev/null 2> /dev/null + tar -czf piwik-$VERSION.tar.gz piwik How\ to\ install\ Piwik.html + mv piwik-$VERSION.{zip,tar.gz} $HTTP_PATH + + zip -r piwik-$VERSION-WAG.zip piwik *.xml *.sql > /dev/null 2> /dev/null + mv piwik-$VERSION-WAG.zip $HTTP_PATH/WebAppGallery/piwik-$VERSION.zip + + if [ `echo $VERSION | grep -E 'rc|b|a|alpha|beta|dev' -i | wc -l` -eq 1 ]; then + echo "Beta or RC release"; + echo $VERSION > $HTTP_PATH/LATEST_BETA + echo "build finished! http://builds.piwik.org/piwik-$VERSION.zip" + else + echo "Stable release"; + + #hard linking piwik.org/latest.zip to the newly created build + for i in zip tar.gz; do + ln -sf $HTTP_PATH/piwik-$VERSION.$i $HTTP_PATH/latest.$i + done + + echo $VERSION > $HTTP_PATH/LATEST + echo "build finished! http://piwik.org/latest.zip" + fi + ;; +esac + +cleanupWorkspace |