diff --git a/.travis.yml b/.travis.yml index 35d06f4..2d8364b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -# See https://gist.github.com/chillu/5262316 for setup details +# See https://github.com/silverstripe-labs/silverstripe-travis-support for setup details language: php php: @@ -17,7 +17,8 @@ matrix: before_script: - pear -q install --onlyreqdeps pear/PHP_CodeSniffer - phpenv rehash - - ./tests/travis/travis_setup.php --target ~/builds/ss + - git clone git://github.com/silverstripe-labs/silverstripe-travis-support.git ~/travis-support + - php ~/travis-support/travis_setup.php --source `pwd` --target ~/builds/ss - cd ~/builds/ss script: diff --git a/tests/travis/_config.php b/tests/travis/_config.php deleted file mode 100644 index b87a6c4..0000000 --- a/tests/travis/_config.php +++ /dev/null @@ -1,50 +0,0 @@ - "PostgreSQLDatabase", - "server" => 'localhost', - "username" => 'postgres', - "password" => '', - "database" => 'SS_travis' - ); - break; -case "MYSQL": - $databaseConfig = array( - "type" => "MySQLDatabase", - "server" => 'localhost', - "username" => 'root', - "password" => '', - "database" => 'SS_travis' - ); - break; -default: - $databaseConfig = array( - "type" => "SQLitePDODatabase", - "server" => 'localhost', - "memory" => true, - "database" => 'SS_travis', - 'path' => dirname(dirname(__FILE__)) .'/assets/' - ); -} - -echo $databaseConfig['type']; - -Security::setDefaultAdmin('username', 'password'); - -// Fake hostname on CLI to stop framework from complaining -$_SERVER['HTTP_HOST'] = 'http://localhost'; - -// Version-specific configuration -$version = getenv('CORE_RELEASE'); -if($version != 'master' && version_compare('3.1', $version) == -1) { - MySQLDatabase::set_connection_charset('utf8'); - SSViewer::set_theme('simple'); -} else { - Config::inst()->update('SSViewer', 'theme', 'simple'); -} \ No newline at end of file diff --git a/tests/travis/travis_setup.php b/tests/travis/travis_setup.php deleted file mode 100755 index cd47f9c..0000000 --- a/tests/travis/travis_setup.php +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env php - array_merge( - isset($package['require']) ? $package['require'] : array(), - array($package['name'] => $moduleBranchComposer . '#' . $moduleRevision,) - ), - // Always include DBs, allow module specific version dependencies though - 'require-dev' => array_merge( - array('silverstripe/postgresql' => '*','silverstripe/sqlite3' => '*'), - isset($package['require-dev']) ? $package['require-dev'] : array() - ), - 'minimum-stability' => 'dev' -); -// Override module dependencies in order to test with specific core branch. -// This might be older than the latest permitted version based on the module definition. -// Its up to the module author to declare compatible CORE_RELEASE values in the .travis.yml. -if(isset($packageNew['require']['silverstripe/framework'])) { - $packageNew['require']['silverstripe/framework'] = $coreBranchComposer; -} -if(isset($packageNew['require']['silverstripe/cms'])) { - $packageNew['require']['silverstripe/cms'] = $coreBranchComposer; -} -$composer = json_encode($packageNew); - -echo "Generated composer file:\n"; -echo "$composer\n\n"; - -echo "Cloning installer@$coreBranch...\n"; -`git clone --depth=100 --quiet -b $coreBranch git://github.com/silverstripe/silverstripe-installer.git $target`; - -echo "Setting up project...\n"; -`cp $dir/_config.php $target/mysite`; - -echo "Replacing composer file...\n"; -unlink("$target/composer.json"); -file_put_contents("$target/composer.json", $composer); - -echo "Running composer...\n"; -passthru("composer install --prefer-dist --dev -d $target"); \ No newline at end of file