Permalink
Browse files

Import latest changes

  • Loading branch information...
1 parent 71f42e5 commit 3636511effb56a26a288486ba6b99ff2fd185ffa root committed Feb 14, 2012
Showing with 177 additions and 25 deletions.
  1. +25 −0 environment
  2. +10 −0 git-push.sh
  3. +38 −0 git-submodules-update.sh
  4. +45 −0 release.sh
  5. +7 −25 tarball.sh
  6. +37 −0 test.sh
  7. +15 −0 violations.sh
View
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# Enable command tracing
+set -o xtrace
+
+# Figure out the source folder
+SOURCEDIR=${SOURCEDIR:-source}
+
+# Figure out what version of Kohana we are building
+pushd ${SOURCEDIR}
+if [ -f "system/classes/kohana/core.php" ];
+then
+ KOHANA_VERSION=`php -r "define('SYSPATH',''); include 'system/classes/kohana/core.php'; echo Kohana_Core::VERSION;"`
+else
+ KOHANA_VERSION=`php -r "define('SYSPATH',''); include 'system/classes/Kohana/Core.php'; echo Kohana_Core::VERSION;"`
+fi
+popd
+
+KOHANA_SERIES=${KOHANA_VERSION%\.[0-9]*} # eg "3.3"
+
+# Is this a master or develop branch build?
+case "$GIT_BRANCH" in
+ *master ) export KOHANA_BRANCH_TYPE="master" ;;
+ *develop ) export KOHANA_BRANCH_TYPE="develop" ;;
+esac
View
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+# Prepare the environment with some common variables
+BASEDIR=$(dirname $0)
+. $BASEDIR/environment
+
+# Push back to where we came from
+pushd ${SOURCEDIR}
+git push ${GIT_BRANCH%%/*} HEAD:${GIT_BRANCH#origin/} || exit 1
+popd
View
@@ -0,0 +1,38 @@
+#!/bin/bash
+env
+# Prepare the environment with some common variables
+BASEDIR=$(dirname $0)
+. $BASEDIR/environment
+
+# Update the submodules
+pushd ${SOURCEDIR}
+git reset --hard
+git clean -fdx
+
+if [ -n "${SUBMODULE}" ];
+then
+ if [ "${SUBMODULE}" == "core" ];
+ then
+ pushd system
+ else
+ pushd modules/${SUBMODULE}
+ fi
+
+ # Update that specific module
+ git checkout ${GIT_BRANCH#origin/}
+ git pull --ff-only
+ popd
+ if [ "${SUBMODULE}" == "core" ];
+ then
+ git commit -m "Update system submodule" system
+ else
+ git commit -m "Update ${SUBMODULE} submodule" modules/${SUBMODULE}
+ fi
+else
+ git submodule foreach git checkout ${GIT_BRANCH#origin/}
+ git submodule foreach git pull
+ git submodule foreach git push
+ git commit -a -m "Update submodules"
+fi
+
+popd
View
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+# Prepare the environment with some common variables
+BASEDIR=$(dirname $0)
+. $BASEDIR/environment
+
+# Cleanup after previous builds
+rm -rf build || true
+mkdir build
+
+# For debugging..
+env
+
+# Lets go..
+pushd $SOURCEDIR/system
+
+# Release the current version.
+if [ -f "classes/kohana/core.php" ];
+then
+ sed -e "s/VERSION_FINAL[ ]*=[ ]*.*/VERSION_FINAL = TRUE/g" -i classes/kohana/core.php
+else
+ sed -e "s/VERSION_FINAL[ ]*=[ ]*.*/VERSION_FINAL = TRUE/g" -i classes/Kohana/Core.php
+fi
+
+git commit -a -m "Releasing Kohana v${KOHANA_VERSION}." || exit 1
+git tag -s v${KOHANA_VERSION} || exit 1
+git push origin HEAD:refs/head/${KOHANA_SERIES}/develop || exit 1
+git push origin HEAD:refs/head/${KOHANA_SERIES}/master || exit 1
+git push origin v${KOHANA_VERSION} || exit 1
+
+# Start the next iteration
+if [ -f "system/classes/kohana/core.php" ];
+then
+ sed -e "s/VERSION[ ]*=[ ]*'.*'/VERSION = '${NEXT_VERSION_NUMBER}'/g" -i classes/kohana/core.php
+ sed -e "s/CODENAME[ ]*=[ ]*'.*'/CODENAME = '${NEXT_VERSION_CODENAME}'/g" -i classes/kohana/core.php
+ sed -e "s/VERSION_FINAL[ ]*=[ ]*.*/VERSION_FINAL = FALSE/g" -i classes/kohana/core.php
+else
+ sed -e "s/VERSION[ ]*=[ ]*'.*'/VERSION = '${NEXT_VERSION_NUMBER}'/g" -i classes/Kohana/Core.php
+ sed -e "s/CODENAME[ ]*=[ ]*'.*'/CODENAME = '${NEXT_VERSION_CODENAME}'/g" -i classes/Kohana/Core.php
+ sed -e "s/VERSION_FINAL[ ]*=[ ]*.*/VERSION_FINAL = FALSE/g" -i classes/Kohana/Core.php
+fi
+
+git commit -a -m "Starting Kohana v${KOHANA_VERSION} iteration." || exit 1
+git push origin HEAD:refs/head/${KOHANA_SERIES}/develop || exit 1
+popd
View
@@ -1,32 +1,14 @@
#!/bin/bash
-# Enable command tracing
-set -o xtrace
+# Prepare the environment with some common variables
+BASEDIR=$(dirname $0)
+. $BASEDIR/environment
# Cleanup after previous builds
-rm -rf $WORKSPACE/*.tar.gz $WORKSPACE/*.zip
-
-# Figure out what version of Kohana we are building
-pushd source
-KOHANA_VERSION=`php -r "define('SYSPATH',''); include 'system/classes/kohana/core.php'; echo Kohana_Core::VERSION;"`
-popd
-
-# Is this a master or develop branch build?
-case "$GIT_BRANCH" in
- *master ) export KOHANA_BRANCH_TYPE="master" ;;
- *develop ) export KOHANA_BRANCH_TYPE="develop" ;;
-esac
-
-# Determine the final version string
-if [ "$KOHANA_BRANCH_TYPE" == "master" ]
-then
- export VERSION="${KOHANA_VERSION}"
-else
- DATE=`date +%Y%m%d`~`date +%H%M`
- export VERSION="${KOHANA_VERSION}+git${DATE}"
-fi
+rm -rf build || true
+mkdir build
# Build the tarball
-pushd source
-tar czf ${WORKSPACE}/kohana-${VERSION}.tar.gz --exclude-vcs --transform "s,^,kohana-${VERSION}/," *
+pushd ${SOURCEDIR}
+tar czf ${WORKSPACE}/build/kohana-${KOHANA_VERSION}~${BUILD_NUMBER}.tar.gz --exclude-vcs --transform "s,^,kohana-${KOHANA_VERSION}~${BUILD_NUMBER}/," *
popd
View
37 test.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# Prepare the environment with some common variables
+BASEDIR=$(dirname $0)
+. $BASEDIR/environment
+
+# Cleanup after previous builds
+rm -rf build || true
+mkdir build
+
+# PHPUnit Params
+PARAMS="--log-junit=../build/junit.xml"
+
+# Figure out what bootstrap fike to use
+if [ "${KOHANA_VERSION%.*}" == "3.0" ]; then
+ PARAMS="${PARAMS} --bootstrap=test1"
+else
+ PARAMS="${PARAMS} --bootstrap=modules/unittest/bootstrap_all_modules.php"
+fi
+
+# Do we only want to run a certain group of tests?
+if [ -n "${PHPUNIT_GROUP}" ]; then
+ PARAMS="${PARAMS} --group ${PHPUNIT_GROUP}"
+fi
+
+# Do we want code coverage?
+if [ -n "${PHPUNIT_COVERAGE}" ]; then
+ PARAMS="${PARAMS} --coverage-clover=../build/clover.xml --coverage-html=../build/coverage"
+fi
+
+# Run the tests..
+pushd $SOURCEDIR
+phpunit $PARAMS modules/unittest/tests.php
+EXIT=$?
+popd
+
+exit $EXIT
View
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+# Prepare the environment with some common variables
+BASEDIR=$(dirname $0)
+. $BASEDIR/environment
+
+# Cleanup after previous builds
+rm -rf build || true
+mkdir build
+
+# Lets go..
+pushd $SOURCEDIR
+phpcs --standard=Kohana -s --extensions=php --report=checkstyle **/classes **/**/classes > ../build/phpcs.xml
+PHPCSEXIT=$?
+popd

0 comments on commit 3636511

Please sign in to comment.