Permalink
Browse files

adding back basic build script

  • Loading branch information...
1 parent 01e6417 commit e3b663d6d4a46af91acecd020e79a92fdd72b6b9 @viveleroi committed Feb 22, 2012
Showing with 77 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +76 −0 build/build.sh
View
@@ -7,3 +7,4 @@ nbproject
.project
config/*
Capfile
+build/aspen-framework
View
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+# THIS SCRIPT WAS DESIGNED TO PREPARE ASPEN FRAMEWORK FOR A PRODUCTION RELEASE
+
+# if [ $# -ne 3 ]; then
+# echo 1>&2 Usage: 1.0 rc1 Release_Candidate
+# exit 0
+# fi
+
+# if [ $2 = "final" ]; then
+# versname=$1
+# else
+# versname=$1$2
+# fi
+
+# remove any existing exports
+rm -rf aspen-framework
+
+# checkout the latest code from trunk
+git clone git@github.com:botskonet/aspen-framework.git
+cd aspen-framework
+
+# checkout the proper branch
+#git checkout --track -b $1$2 origin/$1$2
+
+# get the git revision number
+gitvers=`git describe`
+
+# add in revision to app.default.config.php
+sed -e "s/application_version'] = ''/application_version'] = '$gitvers'/g" app.default.config.php > adc-new.php
+mv adc-new.php app.default.config.php
+
+# add in revision to bootstrap define
+cd system
+sed -e "s/define('FRAMEWORK_REV', 'Git-Version')/define('FRAMEWORK_REV', '$gitvers')/g" bootstrap.php > bootstrap-new.php
+mv bootstrap-new.php bootstrap.php
+cd ..
+
+#remove support dirs
+rm -rf tests
+rm -rf build
+
+# remove all .git directories
+rm -rf .git
+rm -f .gitignore
+rm -f .DS_Store
+
+# comment this out if pushing a true release
+exit 0
+
+# make tarball
+tar czvf af-temp.tar.gz *
+mv af-temp.tar.gz ../aspen-$versname.tar.gz
+cd ..
+rm -rf latest
+mv aspen-framework latest
+
+# get file size
+fsize=$(du -ks aspen-$versname.tar.gz | cut -f1)
+
+# run phpdoc
+phpdoc/phpdoc -c /BUILD/phpdoc.ini
+
+echo "RELEASE BUILD COMPLETE, LOADING TO AMAZON-S3"
+
+# send file to amazon bucket
+s3cmd put --acl-public aspen-$versname.tar.gz s3://aspen-framework/aspen-$versname.tar.gz
+
+# move files
+mv aspen-$versname.tar.gz builds/aspen-$versname.tar.gz
+
+echo "LOADED TO S3, ADDING NEW RELEASE INFO TO MySQL"
+
+mysql -uroot -pURQU9UWpVABgS9Zr3RXhIhxno -D aspen -e "INSERT INTO releases (file_name,file_size,version_number,build_number,release_type,release_timestamp) VALUES ('aspen-$versname.tar.gz','$fsize','$1 $2','$versname','$3','$(date +"%F %T")');"
+
+echo "RELEASE COMPLETE"

0 comments on commit e3b663d

Please sign in to comment.